• Stars
    star
    51,920
  • Rank 217 (Top 0.01 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 14 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple, yet elegant, HTTP library.

Requests

Requests is a simple, yet elegant, HTTP library.

>>> import requests
>>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass'))
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text
'{"authenticated": true, ...'
>>> r.json()
{'authenticated': True, ...}

Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your PUT & POST data — but nowadays, just use the json method!

Requests is one of the most downloaded Python packages today, pulling in around 30M downloads / week— according to GitHub, Requests is currently depended upon by 1,000,000+ repositories. You may certainly put your trust in this code.

Downloads Supported Versions Contributors

Installing Requests and Supported Versions

Requests is available on PyPI:

$ python -m pip install requests

Requests officially supports Python 3.8+.

Supported Features & Best–Practices

Requests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today.

  • Keep-Alive & Connection Pooling
  • International Domains and URLs
  • Sessions with Cookie Persistence
  • Browser-style TLS/SSL Verification
  • Basic & Digest Authentication
  • Familiar dict–like Cookies
  • Automatic Content Decompression and Decoding
  • Multi-part File Uploads
  • SOCKS Proxy Support
  • Connection Timeouts
  • Streaming Downloads
  • Automatic honoring of .netrc
  • Chunked HTTP Requests

API Reference and User Guide available on Read the Docs

Read the Docs

Cloning the repository

When cloning the Requests repository, you may need to add the -c fetch.fsck.badTimezone=ignore flag to avoid an error about a bad commit (see this issue for more background):

git clone -c fetch.fsck.badTimezone=ignore https://github.com/psf/requests.git

You can also apply this setting to your global Git config:

git config --global fetch.fsck.badTimezone ignore

Kenneth Reitz Python Software Foundation

More Repositories

1

black

The uncompromising Python code formatter
Python
38,653
star
2

requests-html

Pythonic HTML Parsing for Humansâ„¢
Python
13,722
star
3

pyperf

Toolkit to run Python benchmarks
Python
785
star
4

cachecontrol

The httplib2 caching algorithms packaged up for use with requests.
Python
467
star
5

fundable-packaging-improvements

Packaging improvements that could be funded
51
star
6

webassembly

A repo to track the progress of Python on WebAssembly (WASM)
48
star
7

request-for

Canonical location of Python Software Foundation Request for Information/Proposal documents.
44
star
8

gh-migration

This repo is used to manage the migration from bugs.python.org to GitHub.
42
star
9

python-in-edu

website for educational python resources
Python
41
star
10

black-pre-commit-mirror

Python
35
star
11

pycon-us-mobile

TypeScript
29
star
12

advisory-database

This is a repository of vulnerability advisories for projects in scope for the Python Software Foundation CVE Numbering Authority (CNA)
Python
25
star
13

bpo-tracker-cpython

Python
24
star
14

project-funding-wg

21
star
15

community-code-of-conduct

The Python Software Foundation Community Code of Conduct
20
star
16

psf-tuf-runbook

A runbook for the PSF, for TUF key setup and initial signing operations to bootstrap signing for PyPI.
Rust
15
star
17

bylaws

PSF Bylaws in markdown format
10
star
18

diversity-and-inclusion-wg

The Diversity and Inclusion Working Group is a volunteer workgroup of the Python Software Foundation. The workgroup's purpose is to further the PSF’s mission to ‘support and facilitate the growth of a diverse and international community of Python programmers.’ We also aim to provide guidance to the PSF Board of Directors in line with this mandate.
CSS
9
star
19

elections

Tools and documentation around running a PSF election
Python
8
star
20

the-invisibles

Pypodcats website
JavaScript
8
star
21

policies

Dockerfile
6
star
22

bpo-roundup

Python
5
star
23

.github

Organization-wide GitHub settings
4
star
24

bpo-tracker-roundup

HTML
1
star
25

bpo-tracker-jython

HTML
1
star
26

fides-deploy

PSFs Deployment of Fides
Python
1
star
27

bpo-rietveld

Python
1
star
28

bpo-django-gae2django

Python
1
star
29

user-success-wg

Repository for the User Success working group at the Python Software Foundation
1
star