toolbelt
toolbelt copied to clipboard
A toolbelt of useful classes and functions to be used with python-requests
Hi, I saw there is no upstream release since more than one year. Are there any plans to make a new release tarball? It will help distributions to use all...
As far as I understand, if SourceAddressAdapter is used with an (IP, PORT) tuple and the port is other than 0, there is no way this adapter can work without...
This docs page on `AuthHandlers` misses one line of code to be working ```python import requests from requests_toolbelt.auth.handler import AuthHandler def gitlab_auth(request): request.headers['PRIVATE-TOKEN'] = 'asecrettoken' return request --> add this...
I need to be able to set a custom header when using threaded.map. Something similar to this: ``` def get_urls(user=None,urls=[]): session = requests.Session() session.headers.update({'Custom-Header': user.custom_header_token}) responses, errors = threaded.map(urls, num_processes=8,...
```python MultipartEncoder(fields={'file[]': [ ('img1.jpg', , 'image/jpeg'), ('img2.jpg', , 'image/jpeg') ]}}) ```
Modern TLS/SSL servers can serve content and certificates based on the Server Name Indication (SNI) that is sent in the Client Hello. By setting the server_hostname in the connection pool...
This is coherent with [what's done in requests](https://github.com/psf/requests/blob/main/requests/models.py#L163). My usecase concerns using [responses.matchers.multipart_matcher](https://github.com/getsentry/responses/blob/master/responses/matchers.py#L233), which uses bare requests to encode the multipart request, while the client, that specifically is [Gitlab's one](https://github.com/python-gitlab/python-gitlab/blob/30117a3b6a8ee24362de798b2fa596a343b8774f/gitlab/client.py#L599),...
Warehouse now uses the project_urls provided to display links in the sidebar on [this screen](https://pypi.org/project/requests/), as well as including them in API responses to help automation tool find the source...
DigestAuth seems to not work when connecting to a HTTPS website. For instance, the following code works: ``` #!/usr/bin/env python3 import requests from requests_toolbelt.auth.http_proxy_digest import HTTPProxyDigestAuth proxies = { "http":...