requests
requests copied to clipboard
A simple, yet elegant, HTTP library.
Good evening The problem was that when checking, we got data that passed the condition test: they contained `:` , and the request did not start with `http`. Example `0.0.0.0:8080`....
With requests v2.20.1, supplying a value of 0 for `chunk_size` causes `iter_content()` to hang. This made debugging code that dynamically computes a value for `chunk_size` difficult. These two lines explicitly...
There is no cross-platform way to catch DNS lookup errors with `requests`. At least I see that error message on Windows https://stackoverflow.com/questions/40145631/precisely-catch-dns-error-with-python-requests looks different from Linux in https://github.com/kennethreitz/requests/issues/3550 Would be...
In requests 2.26.0 with Python 3, when passing unicode strings with surrogate characters as POST data (either directly as a `str` or as part of a `dict`), sending the request...
## Expected Result When connecting to a remote machine via SSL/TLS, and SSL handshake timeout happens, I expect to have `SSLError` or `ConnectionError` exception. ## Actual Result `requests` raises `ReadTimeout`...
Consider the code below (**main.py**). When a temporary network disconnect occurs without the `timeout` keyword argument to `Session.get()`, the client may hang indefinitely and no exception is raised. However, if...
`get_encodings_from_contents` uses regexps: ``` charset_re = re.compile(r']') ``` I'm finding cases where this is matching "random junk charset=something_weird". A real-life example is at https://www.walmart.com/ip/108356879 where I get 7 matches. The...
What `json()` actually does - it deserializes JSON into a Python object. So the docstring below must be wrong: https://github.com/psf/requests/blob/fab1fd10d0b115e635b9ef1364f8444089725000/requests/models.py#L894-L918
requests should pass `ssl_context` to `urllib3.PoolManager`: https://github.com/requests/requests/blob/2a4dd64fb4c072c646277c9d057737b05351b86f/requests/adapters.py#L161-L162 Otherwise a new SSLContext is allocated for all requests. SSLContexsts can be huge, like 1MB, so doing this will be a performance and...
requests seems to have special handling for when the `cert` parameter is a single `str`, but does not extend the same special handling to `pathlib.Path`, meaning currently you either have...