summaryrefslogtreecommitdiff
path: root/requests/models.py
Commit message (Collapse)AuthorAgeFilesLines
* Clarify that PreparedRequests should not be manually createdNick Krichevsky2020-06-181-1/+3
| | | | Closes #5504
* Avoid an unnecessary computation of the length of data for non-stream ↵David Black2020-06-161-5/+5
| | | | requests (which determines content-length based upon body content).
* fix raise_for_status docstring (#5293)Thomas Grainger2020-05-081-1/+1
| | | the exception isn't stored it's created new each call
* Revert "Fix for response with UTF-8 BOM #4976"Nate Prewitt2020-02-181-3/+0
| | | | | | This reverts commit 19cff44ec1b8eeec99459b504a681aa440f6344c. This reverts commit 9e27326d6843e7c26e9847776159eeb68a999675. This reverts commit f507a3ef12ce6e100f68741f68d39bcaf8a70c7a.
* Revert "#4965 fix: Accessing response.content twice removes forgets read error."Nate Prewitt2020-02-181-20/+3
| | | | | | This reverts commit bd100472443dcf4189630f6b1ed3ec0a61259dd8. This reverts commit d91fe00983f1c66b9a428fe1ad15bf6ea8238972.
* Merge pull request #5076 from myrheimb/patch-1Kenneth Reitz2019-08-201-1/+1
|\ | | | | Possible fix for #4945?
| * Possible fix for #4945?Bjørnar Myrheim2019-04-301-1/+1
| | | | | | Could the missing colon on line 612 be the reason for the missing reference in the docs as described in issue #4945?
* | Merge branch 'master' into feature/strip-utf8-bomKenneth Reitz2019-08-201-5/+23
|\ \
| * \ Merge branch 'master' into masterKenneth Reitz2019-08-201-5/+22
| |\ \
| | * \ Merge pull request #5087 from LuckyDenis/masterKenneth Reitz2019-08-201-3/+20
| | |\ \ | | | | | | | | | | #4965 Fix
| | | * | #4965 fix: Accessing response.content twice removes forgets read error.Белавин Денис2019-05-141-7/+16
| | | | |
| | | * | #4965 fix-draw: Accessing response.content twice removes forgets read error.Белавин Денис2019-05-131-0/+8
| | | |/
| | * | Updated references to previous requests/requests GitHub pathNihaal2019-08-191-2/+2
| | |/
| * | [fix] fix failing doctests in requests/*aless102019-02-171-0/+1
| |/ | | | | | | | | [add] add --doctest-modules in pytest.ini file as addopts [add] add myself to AUTHORS
* | fix response with utf8 bomEduardo Rodrigues2019-02-091-0/+3
|/
* Set iter_lines() decode_unicode default to FalseKyle Altendorf2018-11-061-1/+1
| | | The docs just read a bit strange with `decode_unicode=None` as opposed to `False`.
* Use comprehensions whenever possibleHugo Osvaldo Barrera2018-10-161-4/+1
|
* Prefer https:// for URLs throughout projectJon Dufresne2018-09-301-2/+2
|
* Document that 'params' can also be a list of tuplesMatthieu Moy2018-07-171-1/+3
| | | | | Like we just did for 'data', 'params' follows the same processing and can also be a list of tuples.
* Document that 'data' can be a list of tuples everywhereMatthieu Moy2018-07-171-1/+3
| | | | | | | | | | | 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.
* Separate collections from collections.abcRaymond Hettinger2018-06-111-4/+4
|
* Response.content minor perf improvementOfek Lev2018-05-261-1/+1
|
* The library raises NoneType error when file-pointer (fp) resolves to None.Rajiv Mayani2018-05-171-1/+5
| | | | | | | | | | | | | >>> 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.
* Clarify that Response.ok will *only* return True/FalseAlex Chan2017-11-201-2/+2
|
* remove legacy super() callMark Szymanski2017-07-261-2/+0
|
* Allow Requests.Response to be used as a context managerEd Morley2017-06-061-0/+6
| | | | | | | | | | | | | This saves having to wrap the call to requests with `contextlib.closing()`, allowing it to be used directly in a `with` statement, like so: ``` with requests.get('http://httpbin.org/get', stream=True) as r: # Do things with the response here. ``` Fixes #4136.
* cleanup models.pyKenneth Reitz2017-05-291-4/+6
|
* new requests namespaceKenneth Reitz2017-05-291-2/+2
|
* fix models.pyKenneth Reitz2017-05-261-7/+1
|
* fix models.pyKenneth Reitz2017-05-261-5/+6
|
* remove Request.send(session)Kenneth Reitz2017-05-261-6/+2
|
* who wrote this shitKenneth Reitz2017-05-261-2/+4
|
* API improvementsKenneth Reitz2017-05-261-0/+8
|
* Remove some unused imports.Chris Gavin2017-04-251-2/+2
|
* Fixes DeprecationWarnings in Python 3.6 due to invalid escape sequences. ↵Ruben Dura Tari2017-04-051-1/+1
| | | | Fixes #3954
* Update docstrings for Response.__{bool,nonzero}__Ian Cordasco2017-02-161-2/+14
| | | | | Like the docstring added to Response.ok these were misleading and vaguely incorrect. Better to be explicit than implicit.
* Correct docstring for Response.okIan Cordasco2017-02-161-1/+7
|
* added docstring for response.ok propertyMislav Cimperšak2017-02-161-0/+1
|
* lazily load idna libraryMoin2017-01-171-11/+27
|
* Revert "Restrict URL preparation to HTTP/HTTPS"Cory Benfield2016-11-301-3/+3
| | | | This reverts commit 34af72c87d79bd8852e8564c050dd7711c6a08d6.
* Merge pull request #3695 from nateprewitt/idna_bypassCory Benfield2016-11-251-3/+9
|\ | | | | idna bypass
| * modifying IDNA encoding check to allow fallbackNate Prewitt2016-11-211-3/+9
| |
* | Make Response.content return None if raw is NoneNicola Soranzo2016-11-241-1/+1
| | | | | | | | Add test.
* | Make Response.content() return None if status_code is NoneNicola Soranzo2016-11-231-1/+1
| | | | | | Fix #3698.
* | Restrict URL preparation to HTTP/HTTPSChristian Heimes2016-11-211-3/+3
| | | | | | | | | | | | | | | | Requests treats all URLs starting with the string 'http' as HTTP URLs. Preparation with IDNA breaks non-standard URIs like http+unix. Requests now prepares only URLs with prefix http:// and https://. Signed-off-by: Christian Heimes <christian@python.org>
* | Just lstrip instead of strip because trailing whitespace already works.Hussain2016-11-161-2/+2
| |
* | Fixed issue #3696. Added a test for it as well.Hussain2016-11-161-0/+3
|/
* Document that Response.json() may raise ValueErrorChris Martin2016-11-101-0/+1
|
* adding rewind for re-POST bodiesNate Prewitt2016-11-021-0/+14
|
* requests.post checked data parameters for type like dict.Philipp Konrad2016-10-271-1/+1
| | | | Changed the type check to Mapping.