Skip to content
 
 

Latest commit

 

History

6,807 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

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.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2.5k stars

Watchers

10 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages