• Stars
    star
    51,187
  • Rank 206 (Top 0.01 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 13 years ago
  • Updated about 2 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
37,257
star
2

requests-html

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

pyperf

Toolkit to run Python benchmarks
Python
720
star
4

cachecontrol

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

fundable-packaging-improvements

Packaging improvements that could be funded
51
star
6

request-for

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

webassembly

A repo to track the progress of Python on WebAssembly (WASM)
42
star
8

gh-migration

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

python-in-edu

website for educational python resources
Python
39
star
10

black-pre-commit-mirror

Python
34
star
11

bpo-tracker-cpython

Python
23
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
21
star
13

project-funding-wg

21
star
14

community-code-of-conduct

The Python Software Foundation Community Code of Conduct
18
star
15

pycon-us-mobile

TypeScript
13
star
16

psf-tuf-runbook

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

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
8
star
18

bpo-roundup

Python
5
star
19

.github

Organization-wide GitHub settings
4
star
20

the-invisibles

Pypodcats website
JavaScript
3
star
21

fides-deploy

PSFs Deployment of Fides
Python
2
star
22

policies

Dockerfile
2
star
23

bpo-tracker-roundup

HTML
1
star
24

bpo-tracker-jython

HTML
1
star
25

bpo-rietveld

Python
1
star
26

bpo-django-gae2django

Python
1
star