Making GET Requests with the REST API

For testing requests with this module, we can use the http://httpbin.org service and try these requests, executing each type separately. In all cases, the code to execute to get the desired output will be the same, the only thing that will change will be the type of request and the data that is sent to the server:

You can find the following code in the testing_api_rest_get_method.py file:

import requests,jsonresponse = requests.get("http://httpbin.org/get",timeout=5) ...

Get Mastering Python for Networking and Security 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.