Commit Graph

2279 Commits

Author SHA1 Message Date
Nate Prewitt aeda65bbe5 v2.22.0 2019-05-15 12:51:39 -07:00
Matthieu Moy c4d76800e8 get(), request(): fix documentation of 'params'
'params' is sent to the query string, not the body.
2018-12-13 15:57:00 +01:00
Nate Prewitt 5a1e738ea9 v2.21.0 2018-12-09 22:13:32 -08:00
Kyle Altendorf 36412c5ae7 Merge branch 'master' into patch-1 2018-11-09 14:09:08 -05:00
Nate Prewitt 6cfbe1aedd v2.20.1 2018-11-08 09:14:10 -08:00
Kyle Altendorf a7aa86a933 Set iter_lines() decode_unicode default to False
The docs just read a bit strange with `decode_unicode=None` as opposed to `False`.
2018-11-06 12:35:39 -05:00
Maina Nick 045b706b37 Merge pull request #2 from requests/master
Syncing fork to the original repository
2018-10-29 22:55:03 +03:00
unknown ccbffe5a53 Incorrect ValueError Message 2018-10-29 22:53:02 +03:00
Nate Prewitt ea9436a5d6 proper handling for default ports in auth stripping 2018-10-28 23:29:04 -07:00
Nate Prewitt bd840450c0 v2.20.0 2018-10-17 22:32:22 -07:00
Nate Prewitt 7fd9267b3b remove final remnants from 2.6 2018-10-17 00:18:51 -07:00
Hugo Osvaldo Barrera 89ab030cdb Use comprehensions whenever possible 2018-10-16 20:34:22 -07:00
Nate Prewitt bbdbcc8f05 wrap url parsing exceptions from urllib3's PoolManager 2018-09-30 18:36:05 -06:00
Jon Dufresne b0ad2499c8 Prefer https:// for URLs throughout project 2018-09-30 17:14:40 -05:00
Bruce Merry 857e9b7ac2 Rework authorization stripping logic as discussed
The exception for http->https upgrade now requires the standard HTTP(S)
ports to be used, either implicitly (no port specified) or explicitly.
2018-09-14 10:44:43 +02:00
Bruce Merry 3331e2aecd Strip Authorization header whenever root URL changes
Previously the header was stripped only if the hostname changed, but in
an https -> http redirect that can leak the credentials on the wire
(#4716). Based on with RFC 7235 section 2.2, the header is now stripped
if the "canonical root URL" (scheme+authority) has changed, by checking
scheme, hostname and port.
2018-09-14 10:44:43 +02:00
Kale Franz 8023a01dba Fix assumed hostname when using a 'file' URI scheme adapter 2018-08-13 11:28:35 -05:00
Dohyeon Kim 72d96a67ef Add return type on cookies.py
http://docs.python-requests.org/en/master/api/#api-cookies
2018-08-01 17:21:03 +09:00
Lucy Linder 907c927d60 make content-type's charset information case-insensitive
see issue https://github.com/requests/requests/issues/4748 for more information
2018-07-24 18:13:50 +02:00
Matthieu Moy c008bf3883 Document that 'params' can also be a list of tuples
Like we just did for 'data', 'params' follows the same processing and
can also be a list of tuples.
2018-07-17 18:55:55 +02:00
Matthieu Moy 2d1b4482c5 Document that 'data' can be a list of tuples everywhere
The documentation for the 'data' parameter of various functions was
inconsistant. The low-level function, used by every convenience API,
internally uses RequestEncodingMixin._encode_params which accepts list
of tuples as well as dictionaries, hence every function taking a data
parameter also accepts a list of tuple.

Keep the documentation short, but provide a link to Request for
details.
2018-07-17 18:45:43 +02:00
Chih-Hsuan Yen b1a360c2f1 Fix an invalid escape sequence 2018-07-09 01:10:00 +08:00
Steven M. Vascellaro 5d90638281 Misspelled 'proxy' parameter in docstring
The 'proxy' parameter was misspelled as 'proxies' in the docstring.
2018-06-26 14:58:18 -04:00
Steven M. Vascellaro 1c13c5e6f3 Document that requests.session() is depreciated
Adds a docstring note that `requests.session()` is depreciated. Users should
use `requests.Session()` in versions released after Requests v1.0.
2018-06-21 09:46:16 -04:00
Nate Prewitt 883caaf145 v2.19.1 2018-06-14 06:26:27 -07:00
Martin Durant 8031ec76b8 Do not alter status_codes docstring if it is None
With PYTHONOPTIMIZE=2, the current code breaks with TypeError.
2018-06-12 17:52:50 -04:00
Nate Prewitt 991e8b76b7 v2.19.0
* Updated HISTORY.rst.
* Moved version pin for idna to allow recent 2.7 release.
* Updated version warning for urllib3 to allow 1.23.
* Updated metadata dunders in __version__.py.
* Removed Python 2.6 trove classifier.
* Removed Python 2.6 reference from README.rst.
2018-06-12 07:38:10 -07:00
Raymond Hettinger 7e297ed95b Separate collections from collections.abc 2018-06-11 22:14:59 -07:00
Laurent Bachelier 10915e3b0d Add a public method to get the cookie policy 2018-06-11 22:13:07 -07:00
Laurent Bachelier 3ef49272f2 Copy cookie policy when copying a CookieJar
Without it, the cookie policy would get lost while making a request.
That would be invisible to the user if the default cookie policy wasn't
changed, of course.
2018-06-11 22:13:07 -07:00
Ofek Lev c1b828bc95 Response.content minor perf improvement 2018-05-26 18:20:27 -04:00
Rajiv Mayani 8546a15587 The library raises NoneType error when file-pointer (fp) resolves to None.
>>> from requests import post
>>> r = post("https://example.com", files={"file-name": None})

However, when a param value or json field is None they are not included in the request body.

>>> from requests import get
>>> r = get("https://example.com", params={"file-name": None})
>>> r.request.url

This commit makes the beahviour consistent for files.
2018-05-17 13:56:17 -07:00
Ian Stapleton Cordasco 371ee7cbec Merge branch 'master' into master 2018-05-16 08:46:26 -05:00
Julien Prigent 60a5a393d8 Add a comment about lowercase env. variables precedence over uppercase 2018-05-13 06:15:56 -07:00
Elias Obeid 75c57985b0 update json param's description to avoid confusion
- the Request class doesn't accept JSON, but a JSON serializable object
2018-04-30 16:50:23 +02:00
David Poole 85ec7d759e Merge branch 'master' into master 2018-03-05 09:07:12 -07:00
Jon Dufresne 265ef609d5 Remove remaining references to removed, vendored packages (#4499)
As the vendored packages were removing in version 2.16, all remaining
doc references should be replaced with newer practices.
2018-02-17 08:15:54 -06:00
Semen Zhydenko 22120d423e Fix typos
nonexistant -> nonexistent
neccessary -> necessary
2018-02-07 18:25:22 -06:00
Jonathan Elliott Blum 8e040523a4 pass kwargs from send call to add_headers, per documentation 2018-02-02 13:10:16 -05:00
Nate Prewitt f60324a3de append previous url fragment on redirect 2018-01-21 09:55:45 -08:00
Darren Dormer 2255c34a65 Fix DNS resolution by using hostname instead of netloc and strip username and password when comparing against proxy bypass items. 2018-01-16 10:18:06 +01:00
dbairaktaris1 7deee699ad slice function removed 2018-01-04 10:48:17 -06:00
dbairaktaris1 cb0914407b Continue to refactor, remove list comprehension, add double quotes test case. 2018-01-04 10:30:50 -06:00
dbairaktaris1 80a790443e implement changes after code review 2018-01-03 23:41:41 -06:00
dbairaktaris1 071796d83f implement changes after code review 2018-01-03 23:40:08 -06:00
dbairaktaris1 1988d9cf72 Move nested function up to module level and rename. Add more tests for function. 2018-01-01 14:20:55 -06:00
dbairaktaris1 cef0830419 clean 2017-12-31 15:02:39 -06:00
dbairaktaris1 d8666e1906 Reduce overall memory usage of Requests module by removing cgi module dependency in utils.py. Instead wrote a nested function to parse header and return content type and params. 2017-12-31 14:46:15 -06:00
David Poole efacb9e312 Merge branch 'master' into master 2017-11-29 07:13:07 -07:00
Anton Fedchin 714c9dc967 utils: winreg module may not exist like on windows universal platform. 2017-11-25 17:21:59 +03:00