Home >>Python Requests Module >Python Requests get() Method

Python Requests get() Method

Python Requests get() Method

Python Requests get() Method in python is used to sends a request to GET the specified url.

Syntax:
requests.get(url, params={key: value}, args)

Parameter Values

Parameter Description
url It is Required. The request of the url
params It is Optional. A dictionary, to send as a query string. Default value is None
allow_redirects It is Optional. To redirection of a Boolean(Default value is True)
auth It is Optional. to enable a certain HTTP authentication of a tuple. Default value is None
cert It is Optional. It specifying a cert file or key of a string or a tuple. Default value is None
cookies It is Optional. To send to the specified url of a directionary of cookies. Default value is None
headers It is Optional. to send to the specified url of a dictionary of HTTP headers. Default value is None
proxies It is Optional. The proxy url of the protocol. Default value is None
stream It is Optional and indicates a Boolean. Default False
timeout It is Optional. A tuple or a number, indicating how many seconds to wait for the client to make a connection
verify It is Optional. A string or a Boolean indication to verify the servers TLS certificate or not. Default value is True
Here is an example of Python Requests get() Method:

import requests
x = requests.get('https://phptpoint.com')
print(x.status_code)

Output:
200

No Sidebar ads