summaryrefslogtreecommitdiff
path: root/requests/models.py
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Enable UTS46 mode.Cory Benfield2016-10-141-1/+1
|
* Use IDNA2008 to encode hosts.Cory Benfield2016-10-141-2/+3
|
* Remove error swallowing exception catching of AttributeErrorFrankie Robertson2016-09-291-10/+6
|
* Change module of internal references to to_native_str()Brian Bamsch2016-09-271-2/+2
|
* removing redundant logic from prepare_content_lengthNate Prewitt2016-09-211-12/+10
|
* Add workaround to avoid implicit import of encodings.idna.Carson Lam2016-09-171-0/+5
|
* adding commentNate Prewitt2016-09-051-0/+4
|
* adding ISO-8859-1 fallback for reason decodingNate Prewitt2016-09-021-1/+4
|
* adding passthrough in close() for non-urllib3-like ResponsesNate Prewitt2016-08-121-1/+3
|
* Close and then release the connectionIan Cordasco2016-07-301-1/+1
| | | | | | | | | | | | | urllib3 closes the underlying connection when we call urllib3.Response.close but does not release it back to the connection pool. This can cause issues when users have a blocking connection pool configured and connections are not readily returned to the pool. Since the underlying connection is closed, we should be able to safely return the connection to the connection pool, so to fix this issue we merely need to not return after closing the response. Closes gh-3461
* Spelling fixesVille Skyttä2016-07-261-1/+1
|
* Merge pull request #3429 from nateprewitt/docstring_cleanupKenneth Reitz2016-07-201-5/+2
|\ | | | | Docstring cleanup
| * making class and function docstrings consistentNate Prewitt2016-07-201-5/+2
| |
* | adding in pep8 fixesNate Prewitt2016-07-201-6/+7
|/
* Support responses like `HTTP/1.1 404 Unicode chars` (#3385)Andrii Kostenko2016-07-051-2/+6
|
* Merge pull request #3366 from nateprewitt/2947-no-returns-in-headerCory Benfield2016-07-021-4/+8
|\ | | | | check for headers containing return characters
| * check and test for headers containing return characters or leading whitespaceNate Prewitt2016-07-021-4/+8
| |
* | updating docstring to match functionalityNate Prewitt2016-07-021-0/+6
| |
* | Allow None value for chunk_size again (#3368)Joy Zheng2016-06-301-1/+1
|/
* added in type check for chunk_sizeNate Prewitt2016-06-271-0/+2
|
* Merge pull request #3178 from haikuginger/masterCory Benfield2016-05-221-0/+4
|\ | | | | Encoding JSON requests to bytes for urllib3 to handle
| * Cleaning up comment on JSON encoding to be more strictly relevant.Jesse Shapiro2016-05-051-3/+2
| |