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

The general syntax for the request method is:

requests.methodname(params)

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

response.status_code

Get the JSON response by typing

response.json()

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

response = requests.post(URL)

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

response.status_code

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

response.json()