Python Requests Module

Python Requests Module

Example

Make a request to a web page, and print the response text:

Run Example »


Definition and Usage

The requests module allows you to send HTTP requests using Python.

The HTTP request returns a Response Object with all the response data (content, encoding, status, etc).


Download and Install the Requests Module

Navigate your command line to the location of PIP, and type the following:

C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip install requests

Syntax


Methods

Method Description
delete(urlargs) Sends a DELETE request to the specified url
get(urlparams, args) Sends a GET request to the specified url
head(urlargs) Sends a HEAD request to the specified url
patch(urldata, args) Sends a PATCH request to the specified url
post(urldata, json, args) Sends a POST request to the specified url
put(urldata, args) Sends a PUT request to the specified url
request(methodurlargs) Sends a request of the specified method to the specified url
ArmenianEnglish