Flask: Echo GET - using curl and requests
We can test the application externally as well.
For this we first have to make sure the application runs. Then we can use either curl the command line too or the requests library of Python.
curl http://localhost:5000/
curl http://localhost:5000/echo?text=Sanch+Panza
Python requests
pip install requests
import requests
res = requests.get('http://localhost:5000/')
print(res.status_code)
print(res.text)
res = requests.get('http://localhost:5000/echo?text=Hello World!')
print(res.status_code)
print(res.text)