Making HTTP requests to the Tornado API
Now, we can run the api.py
script that launches Tornados's development server to compose and send HTTP requests to our unsecure and simple Web API. Execute the following command:
python api.py
The following lines show the output after we execute the previous command. The Tornado HTTP development server is listening at port 8888
:
Listening at port 8888
With the previous command, we will start the Tornado HTTP server and it will listen on every interface on port 8888
. Thus, if we want to make HTTP requests to our API from other computers or devices connected to our LAN, we don't need any additional configurations.
Tip
If you decide to compose and send HTTP requests from other computers or devices connected to ...
Get Building RESTful Python Web Services now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.