Requests is an HTTP library in python that allows you to send HTTP requests using python

The general syntax for the request method is:


There are many request methods available for use in python: 1. POST 2. GET 3. REQUEST 4. HEAD etc

GET is the most commonly used method to obtain data from an API endpoint.

response = requests.get(URL)

If the request is successful, the user will get 200 as a status code


Get the JSON response by typing


Post request is used to submit data to be processed to the server.

response =

Command to get the status code of the post request. Status code 200 means success.


Similarly, To get the json-encoded content of a response