kennethreitz
0e51e48473
PreparedRequest.send()
2016-02-02 02:12:38 -05:00
kennethreitz
0f930d99f2
resolve merge errors causing test failures
2016-02-02 00:10:06 -05:00
kennethreitz
a0b7bdd187
Merge commit '1881851' into v3.0.0
2016-02-01 23:57:29 -05:00
kennethreitz
6dff2bb71c
Merge commit '8c4d4f1af3a501ae0beec5e270f3206cda5c4842' into v3.0.0
2016-02-01 23:46:26 -05:00
kennethreitz
26cf9abfd6
Merge commit '4aa4f82b37aeb272637fafeff498014af1c11c6b' into v3.0.0
2016-02-01 23:39:17 -05:00
kennethreitz
d1871fabe9
Merge commit 'ff8153d9c56bfa62782fb99743219d0b02b512bb' into v3.0.0
2016-02-01 23:28:55 -05:00
kennethreitz
45f110b52d
Merge commit '636b946af5eac8ba4cffa63a727523cd8c2c01ab' into v3.0.0
2016-02-01 23:28:26 -05:00
Chad Whitacre
f8d2fb83a3
Rename {Missing,Invalid}Schema to *Scheme
...
Schemes are what they're called, not schemas.
Conflicts:
requests/models.py
2016-01-05 12:20:20 -05:00
Cory Benfield
fc8fa1aa26
Fix regression from #2844 regarding binary bodies.
2015-12-16 14:56:13 +00:00
Ian Cordasco
40ce36671c
Merge pull request #2896 from BraulioVM/master
...
[WIP] Set 'Transfer-Encoding: chunked' if data is a file with length 0
2015-12-02 08:35:41 -06:00
Jakub Wilk
23d9b077d8
Fix typos
2015-12-01 12:24:56 +01:00
Braulio Valdivielso Martínez
4c82dbab6f
Fix 'Transfer-Encoding: chunked' change
2015-11-24 13:42:13 +01:00
Braulio Valdivielso Martínez
6f6b2fd1d5
Set 'Transfer-Encoding: chunked' if data file length equals 0
2015-11-23 20:52:06 +01:00
Alex Khomchenko
edc68a0ac8
fix issue #2844
2015-10-23 15:22:36 +03:00
Cory Benfield
2df3c7c75d
Move to_native_string for methods to prepare()
2015-10-12 10:50:37 +01:00
Cory Benfield
3948a9562d
Use general null check for JSON
2015-10-08 14:53:35 +01:00
Cory Benfield
f6afa71281
Merge pull request #2763 from ravipra/json_supersedes
...
Fixed issue #2756
2015-10-05 15:27:53 +01:00
sumitbinnani
bf38d5bf52
Update models.py
...
Updated Documentation:
```data``` as well as ```files``` supersedes json
2015-10-02 13:50:52 +05:30
Ravi Prakash Putchala
7a0cd16c1a
changed the null check for 'data' parameter to be more explicit.
...
removed the superfluous encode from the testcase.
2015-09-09 13:04:24 +05:30
Ravi Prakash Putchala
37037607b5
Fixed issue #2756
...
Now 'json' parameter will be used to prepare body only if the 'data'
parameter is not present
2015-09-08 14:45:46 +05:30
Marc Abramowitz
e3bdec5934
Display URL as part of HTTP error messages
...
It seems convenient to include the URL in the error message in case you
get an unexpected error.
E.g.:
In [1]: import requests
In [2]: resp = requests.get('http://www.google.com/eofdfdfdfdfd ')
In [3]: resp
Out[3]: <Response [404]>
In [4]: resp.raise_for_status()
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
<ipython-input-4-00e7077cfb5b> in <module>()
----> 1 resp.raise_for_status()
/Users/marca/dev/git-repos/requests/requests/models.py in raise_for_status(self)
835
836 if http_error_msg:
--> 837 raise HTTPError(http_error_msg, response=self)
838
839 def close(self):
HTTPError: 404 Client Error: Not Found for url: http://www.google.com/eofdfdfdfdfd
2015-06-22 13:22:59 -07:00
Ian Cordasco
8c4d4f1af3
Move handling of method to PreparedRequest
2015-06-02 14:02:46 -05:00
Ian Cordasco
4aa4f82b37
Make the tests pass the method to Request
2015-05-30 09:32:31 -05:00
Cory Benfield
ff8153d9c5
Better default for request method
2015-05-28 18:33:24 +01:00
Cory Benfield
50a65a7415
Convert method to native str in request
2015-05-28 18:08:28 +01:00
colin
1da62a65d9
fix contextlib.closing bug for sessions where content is not consumed (issue #2593 )
2015-05-24 15:01:34 -04:00
Ian Cordasco
639f8347a3
Merge pull request #2598 from Lukasa/not-poor
...
Partially revert ab84f9be57
2015-05-14 17:32:19 -05:00
Cory Benfield
553907aa6b
Use complexjson everywhere
2015-05-14 22:30:24 +01:00
Cory Benfield
fb6dade63d
Partially revert ab84f9be57
2015-05-14 20:58:20 +01:00
Thomas Weißschuh
c6c8d649af
do not blindly catch all AttributeErrors
...
see shazow/urllib3#618
2015-05-12 23:21:03 +00:00
kennethreitz
868625532d
Merge remote-tracking branch 'origin/master'
2015-05-06 12:42:47 -07:00
kennethreitz
74609c5c8f
cleanup styles a bit
2015-05-06 12:42:43 -07:00
kennethreitz
ab84f9be57
removed poor code
2015-05-06 12:36:26 -07:00
Ian Cordasco
52bc2e57c0
Remove the __bool__ and __nonzero__ response methods
...
Many people expect to be able to say:
response = make_request(url)
if response:
body = response.content
Where the first part should test for whether or not response is None.
Instead, the __bool__ and __nonzero__ methods return response.ok, so if
the response is actually a 4xx or 5xx response, then the user would
expect to get the body of the response.
By removing these methods, we restore the functionality that most users
expect.
Closes #2002
2015-05-04 07:58:04 -05:00
Ian Cordasco
35045e851a
Simplify PreparedRequest.prepare API
...
Do not require that hooks be passed as an empty list to
PreparedRequest.prepare. In the event hooks is None in prepare or
prepare_hooks, use an empty list as a default.
Related to #2552
2015-04-20 20:13:58 -05:00
Ian Cordasco
a0632d8df0
Minor formatting change
2015-04-10 22:03:26 -05:00
sh1buy
599f834351
fix bug 2540
2015-04-11 03:29:21 +03:00
sh1buy
f02d0f9e79
Fix bug 2540
2015-04-11 01:41:02 +03:00
sh1buy
f89b5a5d90
fix bug 2540
2015-04-11 00:23:07 +03:00
Smiley Barry
e3c7b43fc9
#2532 : Documented strange behaviour in "PreparedRequest.prepare_cookies", caused by cookielib. Also documented a workaround if absolutely necessary.
2015-04-06 21:00:51 +03:00
Ian Cordasco
36093e69c7
Copy a PreparedRequest's CookieJar reliably
...
When a PreparedRequests's cookie jar is not a RequestsCookieJar instance, it
will not have a "copy" method. By adding _copy_cookie_jar we can reliably copy
cookie jars so that we have an actual copy instead of the same instance on
different prepared requests.
This also updates the RequestsCookieJar.update logic to create copies of
cookies from the other jar.
Closes #2527
2015-04-05 21:49:52 -05:00
Cory Benfield
54791d1970
Expand on what 'elapsed' means.
2015-03-21 16:27:21 +00:00
Ian Cordasco
bbbd9de6fd
Merge pull request #2472 from scholer/master
...
Avoid data duplication when creating a Request with str/bytes/bytearray input
2015-03-14 07:43:17 -05:00
Priit Laes
4497a26c37
Document Response.iter_lines() reentrancy issues
2015-03-07 12:00:41 +02:00
Rasmus Scholer (TimelineX)
ec700a9a13
Avoid duplicating files data when creating a Request with str/bytes/bytearray in the files argument. 30-40% performance improvement.
2015-03-04 10:21:38 -05:00
Rasmus Scholer (TimelineX)
11b12c3e07
models.RequestEncodingMixin._encode_files now takes bytearray as fp in addition to the currently supported bytes and str input.
2015-03-03 02:44:52 +01:00
Ian Cordasco
bd3cf95e34
Fix error handling on Python 3
2014-12-16 22:49:24 -06:00
Ian Cordasco
386c589ba0
Merge branch 'master' of https://github.com/ContinuousFunction/requests into pr/2344
2014-12-16 22:18:51 -06:00
daftshady
925e975295
catch exception more specifically in Response.ok
2014-12-16 16:55:13 +09:00
ContinuousFunction
3246b1fe17
Changed ConnectionError to InvalidURL
2014-11-17 20:06:24 -08:00