“Safest, Fastest, Easiest, and Most advanced” Python HTTP Client. Production Ready! Drop-in replacement for Requests. HTTP/1.1, HTTP/2, and HTTP/3 supported. With WebSocket!
[ ] Explain the use-case carefully.
When using Session object, it makes sense to have the option to use a url to prefix all the requests calls, this avoid redundancy and better handling of concatenation between the url and the endpoint
with requests.session(base_url='http://api.example.com') as s:
resp = s.get('/v1/users')
[ ] Who needs this?
This was a recurrent issue on the requests package
[ ] What pain does this resolve?
The Session object is used to persist parameters/cookies/headers between different requests, and I find it makes sense to also persist the base_url, as it will simplify the code and the "process" of appending endpoint to url, by normalizing the handling of '/'
[ ] Is this standard?
I am not sure how to answer this, but for example:
We just implemented this. And will be available in the next minor version.
To have an early access, install Niquests via git. pip install git+https://github.com/jawah/niquests.