GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jawah/niquests: Drop-in replacement for Requests. Automatic HTTP/1.1, HTTP/2, and HTTP/3. WebSocket, and SSE included. WASI Supported.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

6,819 Commits
6,819 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
src/niquests
src/niquests
 
 
tests
tests
 
 
traefik
traefik
 
 
.coveragerc
.coveragerc
 
 
.git-blame-ignore-revs
.git-blame-ignore-revs
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.readthedocs.yaml
.readthedocs.yaml
 
 
AUTHORS.rst
AUTHORS.rst
 
 
HISTORY.md
HISTORY.md
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
Makefile
Makefile
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
docker-compose.win.yaml
docker-compose.win.yaml
 
 
docker-compose.yaml
docker-compose.yaml
 
 
noxfile.py
noxfile.py
 
 
pyproject.toml
pyproject.toml
 
 
requirements-dev.txt
requirements-dev.txt
 
 
requirements-wasi.txt
requirements-wasi.txt
 
 
requirements-wasm.txt
requirements-wasm.txt
 
 

Repository files navigation

Niquests Logo

Niquests is a simple, yet elegant, HTTP library. It is a drop-in replacement for Requests, which is under feature freeze. ✨ Were you used to betamax, requests-mock, responses, ...? See how they still work! We got you covered.

Live Benchmark

Target: https://httpbingo.org/get
Conditions: All default parameters, one shared session, everything simultaneously.
HTTP/2 when supported.
Niquests Benchmark
>>> import niquests
>>> r = niquests.get('https://httpbingo.org/get', params={'hello': 'world'}, timeout=10)
>>> r.raise_for_status()
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf-8'
>>> r.json()['args']
{'hello': ['world']}

The same request using async/await:

import asyncio

import niquests


async def main() -> None:
    async with niquests.AsyncSession() as session:
        r = await session.get(
            'https://httpbingo.org/get', params={'hello': 'world'}, timeout=10
        )
        r.raise_for_status()
        print(r.json()['args'])  # {'hello': ['world']}


asyncio.run(main())

Use params= for query parameters, data= for form fields, and json= for JSON request bodies. Call response.json() to decode a JSON response.

PyPI Downloads Supported Versions OpenSSF Best Practices

This project does not require any compilation toolchain. The HTTP/3 support is not enforced and installed if your platform can support it natively (e.g. pre-built wheel available).

✨ Installing Niquests and Supported Versions

Niquests is available on PyPI:

$ python -m pip install niquests

Niquests officially supports Python or PyPy 3.7+. Even WASI or Pyodide!

🚀 Supported Features & Best–Practices

Niquests is ready for the demands of building scalable, robust and reliable HTTP–speaking applications.

  • DNS over HTTPS, DNS over QUIC, DNS over TLS, and DNS over UDP
  • Automatic Content Decompression and Decoding
  • OS truststore by default, no more certifi!
  • OCSP Certificate Revocation Verification
  • Advanced connection timings inspection
  • In-memory certificates (CAs, and mTLS)
  • Browser-style TLS/SSL Verification
  • Certificate Revocation List (CRL)
  • Sessions with Cookie Persistence
  • Keep-Alive & Connection Pooling
  • International Domains and URLs
  • Automatic honoring of .netrc
  • Basic & Digest Authentication
  • Familiar dict–like Cookies
  • Network settings fine-tuning
  • HTTP/2 with prior knowledge
  • Browser TLS Impersonator
  • Object-oriented headers
  • Multi-part File Uploads
  • Swappable TLS Backend
  • Post-Quantum Security
  • Chunked HTTP Requests
  • Fully type-annotated!
  • Run in the Browser!
  • SOCKS Proxy Support
  • Connection Timeouts
  • Streaming Downloads
  • HTTP/2 by default
  • HTTP/3 over QUIC
  • Early Responses
  • Happy Eyeballs
  • Multiplexed!
  • Thread-safe!
  • WebSocket!
  • Trailers!
  • DNSSEC!
  • Async!
  • WASI!
  • SSE!
  • ECH!

Need something more? Create an issue, we actively listen.

📝 Why did we pursue this?

For many years now, Requests has been frozen. Being left in a vegetative state and not evolving, this blocked millions of developers from using more advanced features.

We don't have to reinvent the wheel all over again, HTTP client Requests is well established and really pleasant in its usage. We believe that Requests has the most inclusive and developer friendly interfaces. We intend to keep it that way. As long as we can, long live Niquests!

How about a nice refresher with a mere CTRL+H import requests to import niquests as requests ?

💼 For Enterprise

Professional support for Niquests is available as part of the Tidelift Subscription. Tidelift gives software development teams a single source for purchasing and maintaining their software, with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.

You may also be interested in unlocking specific advantages (like access to a private issue tracker) by looking at our GitHub sponsor tiers.


Niquests is a highly improved HTTP client that is based (forked) on Requests. The previous project original author is Kenneth Reitz and actually left the maintenance of Requests years ago.

About

Drop-in replacement for Requests. Automatic HTTP/1.1, HTTP/2, and HTTP/3. WebSocket, and SSE included. WASI Supported.

niquests.readthedocs.io/en/latest/

Topics

asyncasynciocertificate-revocationdns-over-httpsdns-over-tlsdnssecdohdoqhappy-eyeballshttphttp-clienthttp2http3multiplexedocsppost-quantumpythonquicrequestswebsocket

Resources

Readme
License

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

2.5k stars

Watchers

10 watching

Forks

56 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.