HTTP and Flask Basics – Introduction to Curl and Chrome Dev Tools
Chrome Dev Tools
If you want to check how your requests are being sent, and what the responses are from the browser, you can do so using Chrome Dev Tools. There are numerous tools within it, but the key area you will use is the Network tab.
Curl is a library and command-line tool that completes IP transfers of data using URLs. One quick way to test your API while your API server is running is to run a curl command in another terminal window.
$ curl -X POST http://www.example.com/tasks/
The above is a sample curl request. Every request starts off with the command curl and needs to include a URL. Other parts you see added in are options that you can use to build your request. In the example, the -X shortform option (also –request) specifies the request method.
You can find more options by entering the following command in the terminal:
$ curl --help
Try piping the output to the jq, a command-line JSON processor, as shown below:
$ curl https://example/test | jq '.'