Getting initial Response
The get() method is used to get the basic information of the resources used at the server-side. This function fetches the data from the server and returns as a response object which can be printed in a simple text format.
Python3
# Import libraries import requests # Sending Request # Show results print (req.text[: 2000 ]) |
Output:
Network Programming Python – HTTP Clients
The request from the client in HTTP protocol reaches the server and fetches some data assuming it to be a valid request. This response from the server can be analyzed by using various methods provided by the requests module. Some of the ways below provide information about the response sent from the server to the Python program running on the client-side :