Commit Graph

1248 Commits

Author SHA1 Message Date
Michael Komitee d0285fac42 Use user supplied options when resending authenticated requests
Hooks sometimes have to send requests (e.g. when responding to a 401 during
authentication).

All keyword arguments should be passed along when hooks are dispatched so that
if a user wanted to use a timeout, stream, specify a cert location with the
verify flag, etc, their specification can be followed.
2013-02-13 19:11:38 -05:00
Ian Cordasco 4dfd6f3fc1 Dispatch hooks before following redirects
Fixes #1183
2013-02-12 23:00:06 -05:00
Kenneth Reitz cdec20af65 Merge pull request #1181 from denis-ryzhkov/master
Fix of UnicodeDecodeError on unicode header name that can be converted to ascii.
2013-02-12 08:43:02 -08:00
Denis Ryzhkov 56f4b7ca68 Deleted is_py2 check from unicode_header_name fix thanks to Lukasa. 2013-02-12 09:51:46 +03:00
Piotr Dobrogost 4c8d1b9a7d removed no longer used redirect codes from models
added numeric values of redirect codes in comments
2013-02-11 23:07:12 +01:00
Denis Ryzhkov 6da7e22a4a Fix of UnicodeDecodeError on unicode header name that can be converted to ascii. 2013-02-11 15:37:58 +03:00
Kenneth Reitz 5d9fcc711b Merge pull request #1180 from sigmavirus24/master
Fix Session level Cookie Handling
2013-02-10 16:43:21 -08:00
Ian Cordasco 2e31696156 Test and perfection for cookie handling.
I also fixed up some of the RequestsCookieJar methods so using
jar.update(other_jar) works without a problem. This cleans up some of the code
in sessions and the resolve_redirects method.
2013-02-10 19:36:36 -05:00
Kenneth Reitz 1da1490bcd urllib3 update
#1053
2013-02-10 17:43:58 -05:00
Ian Cordasco 9cdc8325ae Fix Setting a cookie on redirect 2013-02-10 17:43:37 -05:00
Ian Cordasco 9c8660dbb6 Resolve @piotr-dobrogost's concerns
Piotr had good objections to my not re-sending the body of the request on 307.
2013-02-10 17:14:45 -05:00
Ian Cordasco e7bc9bf1b2 Preserve the original request.
Let's make a copy to preserve it.
2013-02-10 17:11:16 -05:00
Ian Cordasco e2ad0d0fe8 We shouldn't be sending the data on redirect.
As such, we should remove the body from the old request as well as the
Content-Length header.
2013-02-10 17:11:16 -05:00
Ian Cordasco 3299771e34 Fix the potential issue mentioned in #1151
See: https://github.com/kennethreitz/requests/pull/1151#issuecomment-12905796

This is solved by just reusing the PreparedRequest from the last request.
2013-02-10 17:11:16 -05:00
Kenneth Reitz f2be5fae27 Merge pull request #1161 from sigmavirus24/fix1159
If Content-Length is already set, don't override
2013-02-10 14:07:08 -08:00
Cory Benfield b0657cf163 Guard against users sending unprepared requests. 2013-02-10 06:13:02 +00:00
Cory Benfield d437c338d0 Add Proxy-Auth header when proxies have credentials. 2013-02-06 18:40:35 +00:00
Kenneth Reitz 9fc7059140 Merge pull request #1151 from sigmavirus24/fix1133
Move redirect handling from Session.request to Session.send
2013-02-05 11:42:51 -08:00
Ian Cordasco 544d08d0f6 If Content-Length is already set, don't override
Re: #1159
2013-02-01 11:58:23 -05:00
Yehuda Sadeh b07c1ebd85 Fix POST 303 redirect resonse handling
This fixes issue #1156.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-01-31 11:23:09 -08:00
Christopher Bare 9ff8cbe5fb shorten filename by os.path.basename in guess_filename(obj) 2013-01-30 15:33:43 -08:00
Ian Cordasco ba485913b6 Thanks to @maxcountryman for the code review 2013-01-30 10:58:32 -05:00
Ian Cordasco a95bfd3032 Fix the elapsed test and #1133 2013-01-29 23:50:37 -05:00
Cory Benfield 2f7923bc05 More useful docstring. 2013-01-28 18:35:41 +00:00
Cory Benfield 2ac3913733 Make Response objects iterable. 2013-01-28 18:35:41 +00:00
Ian Cordasco c8ad4f0b73 Move the timing work to Session.send
per @kennethreitz's request
2013-01-28 11:53:02 -05:00
Kenneth Reitz 25545b393b Merge pull request #1146 from oczkers/master
It`s more pep8 now
2013-01-27 19:11:15 -08:00
Chris Lee 318300848f Use timedelta and change attribute name back to elapsed 2013-01-27 19:07:48 -08:00
Chris Lee d4aaef1e9a Time how long each request takes
Stored as attribute Response.time_taken
2013-01-27 19:06:50 -08:00
oczkers 40a060cf57 it`s more pep8 now 2013-01-27 02:04:12 +01:00
Kenneth Reitz 9d1d927420 Merge pull request #1103 from dmckeone/master
Restore the ability to use a list of 2-tuples for the data keyword argument with requests.post.
2013-01-25 21:02:01 -08:00
Kenneth Reitz 440aeca5d4 Merge pull request #1123 from andrewjesaitis/master
Fixes DigestAuth with Sessions
2013-01-25 21:00:33 -08:00
Johnny Goodnow 8d8865aadb Remove Content-Length from GET/HEAD by default.
Now, Content-Length is only auto-added for non-GET/HEAD requests.
2013-01-25 20:50:58 -08:00
Johnny Goodnow f7c10ca74d Always add Content-Length to HTTP PATCH. 2013-01-25 12:07:24 -08:00
Johnny Goodnow 44b1e7ebea Remove default Content-Length from GET requests.
Fix #1051.
2013-01-24 21:13:32 -08:00
sprt ab2e7df8a9 Merge branch 'master' of git://github.com/kennethreitz/requests
Conflicts:
	test_requests.py
2013-01-24 18:36:53 +01:00
Scott Burns 2bcc4a774a Pass kwargs to json.loads
Not all JSON is created equally. This commit
addresses when users want to take control of the
json decode process.
2013-01-23 15:25:48 -06:00
Andrew Jesaitis 34268b16c3 Moves num_401_calls counter to HTTPDigestAuth 2013-01-23 10:32:56 -07:00
Ian Cordasco 1cfe59299b Only call the hook once. 2013-01-23 11:51:37 -05:00
Ian Cordasco e771aa9386 Comment & replace something that keeps disappearing 2013-01-23 11:28:30 -05:00
sprt cc7bee19f0 Refactor prepare_hooks() 2013-01-23 15:45:44 +01:00
sprt 088f908d58 Add missing import 2013-01-23 15:45:14 +01:00
sprt c4ad8afba9 Merge remote-tracking branch 'upstream/master'
Conflicts:
	requests/sessions.py
2013-01-23 14:42:45 +01:00
Kenneth Reitz 0c09d16b29 Merge pull request #1125 from juanriaza/master
HTTPDigestAuth: missing algorithm field
2013-01-22 19:43:50 -08:00
Kenneth Reitz 30573b2d8b Merge pull request #1116 from Lukasa/master
Correct type of Content-Length headers.
2013-01-22 18:51:17 -08:00
Kenneth Reitz 1a87f15e6f Merge pull request #1117 from sigmavirus24/issue1106
Fix #1106
2013-01-22 18:48:31 -08:00
Kenneth Reitz 472a5b4748 Merge pull request #1127 from sigmavirus24/fix1126
A simple fix
2013-01-22 17:53:16 -08:00
Mantas Vidutis 6e53290acd update urllib3 to current master with ssl bugfixes 2013-01-22 14:40:10 -08:00
Ian Cordasco ca85b4ec6c Tests pass this time. 2013-01-22 17:22:12 -05:00
Juan Riaza a6360ca134 missing algorithm field 2013-01-22 16:35:16 +01:00