Commit Graph

544 Commits

Author SHA1 Message Date
Cory Benfield a5e5a51fb4 Catch UnsupportedOperation. 2013-08-03 19:24:23 +01:00
Kenneth Reitz 1a6637c285 Merge branch 'keytype' of git://github.com/Lukasa/requests into 2.0 2013-07-31 21:25:57 -04:00
Kenneth Reitz d5a8816926 Merge pull request #1498 from Lukasa/incompleteread
Wrap IncompleteRead in ChunkedEncodingError.
2013-07-31 18:23:14 -07:00
Kenneth Reitz 6b13ecdc85 Merge pull request #1501 from sigmavirus24/remove_setting_of_hooks
Fix duplication of efforts caught by @dofelw
2013-07-31 18:22:58 -07:00
Robert Estelle 0ab7a52f7c Merge settings when creating PreparedRequest, don't copy Request. 2013-07-31 13:42:02 -07:00
Robert Estelle ee90f0af60 Shallow copy of Request fields in Request.copy()
This prevents e.g. modifying the headers of a copied request from
affecting the headers of its source and vice versa. Copying is used with
the intent to mutuate, so allowing this kind of mutation of fields makes
sense.

Is a deep copy better?
2013-07-30 22:59:53 -07:00
Robert Estelle b5c136152f Prepare requests with session settings separately from sending. 2013-07-30 21:39:36 -07:00
Cory Benfield 7de6b1e162 Instantiate the CID directly.
No need to do this the slow way now. Thanks to Colin (@cdunklau) for the
idea.
2013-07-29 14:52:44 +01:00
Cory Benfield f5775594cc Header keys should be native strings.
This commit follows a discussion on IRC. For more information, see the
Pull Request associated with it.
2013-07-29 14:52:44 +01:00
Ian Cordasco 37786613e0 Fix duplication of efforts caught by @dofelw 2013-07-29 08:09:07 -05:00
Cory Benfield 79f3e69f5e Wrap IncompleteRead in ChunkedEncodingError. 2013-07-28 07:42:17 +01:00
Cory Benfield 9473f15909 Merge pull request #1494 from Lukasa/close
Document the Response.close() method.
2013-07-27 23:04:34 -07:00
Kenneth Reitz 77bd9c4a9d Merge pull request #1476 from sigmavirus24/add_copy_to_prepared_requests
[2.0] Add copy method to PreparedRequest objects
2013-07-26 18:16:00 -07:00
Cory Benfield f401287afb Document the Response.close() method. 2013-07-25 19:10:42 +01:00
David Pursehouse 4f64938ff0 Fix a few warnings flagged by PyDev
- Unused import of urlparse
- Unnecessary definition of variable
- Incorrect indentation
2013-07-22 17:14:45 +09:00
Ian Cordasco b84547d786 Add copy method to PreparedRequest objects 2013-07-20 17:08:35 -04:00
Cory Benfield 555472bf1e Remove urllib3-specific kwargs from general code 2013-07-04 10:34:43 +01:00
Cory Benfield 1faa76a86f Use the new urllib3 stream generator. 2013-06-18 17:56:35 +01:00
Jeff Mancuso e7c9bbb96f Only switch to chunked if we don't know the length of a file like object. This fixes the case of trying to upload a 0-length file - chunked upload was being forced. Services like S3 that disallow chunked upload will fail. 2013-05-23 11:21:29 -04:00
papaeye 715a57dec8 Fix typo, %t -> %r 2013-05-22 02:20:51 +09:00
Ib Lundgren 003c795afe Only pass unicode fieldnames to urllib3. 2013-05-21 09:46:28 +01:00
Dave Shawley 6e76ab7188 Fix for #1362.
`PreparedRequest.prepare_url` incorrectly applied IDNA encoding to the
URLs entire `netloc`.  It should only be encoding the hostname portion
of the URL.  IDNA encoding was limiting the user info, host, and port
segments to be a maximum of 63 characters which causes problems for
all by the most trivial user + password combinations.

- Replaced usage of `urlparse` in `PreparedRequest.prepare_url` with
  `urllib3` equivalent.
- Modified IDNA encoding section so that it only encodes the host
  portion of the URL.
2013-05-16 13:12:34 -04:00
Ian Cordasco 88fda94218 Prevent a KeyError when there's no link headers 2013-05-08 23:26:49 -04:00
Kenneth Reitz 6046fcffe8 Merge pull request #1279 from jemerick/unicode_multipart_post
Unicode strings in multipart post requests
2013-04-16 12:55:58 -07:00
schlamar 59f916ca4a Use streaming decompression feature of urllib3. 2013-04-10 08:08:33 +02:00
Ian Cordasco afcc883d7f Fix #1293 2013-04-06 11:26:52 -04:00
Jason Emerick e7247ce3f6 model the encode_files data handling after encode_params 2013-04-02 14:22:49 -04:00
Kenneth Reitz 9c18febf45 Merge pull request #1277 from pborreli/typos
Fixed typos
2013-04-01 21:36:39 -07:00
Jason Emerick f37b968475 use compat.str instead of compat.builtin_str 2013-04-01 18:14:52 -04:00
Pascal Borreli 037b38badb Fixed typos 2013-04-01 18:02:18 +00:00
Alex Gaynor 39acf1dbd2 is should not be used for comparing numbers 2013-03-31 23:20:46 -07:00
Ian Cordasco 0cd23d8d6e Fix the tests and unseparate comments from code
See the comments on the previous few commits on GitHub.
2013-03-28 08:33:34 -04:00
Ian Cordasco 1d5c4f3f0f This should take care of #1266
We were sending 'None' as the Content-Length on requests where the body was a
generator. This commit should prevent that entirely.
2013-03-27 23:26:11 -04:00
Justin Fenn 6963b8490c Clarify streaming behavior in iter_lines doc 2013-03-25 12:20:33 -07:00
Kenneth Reitz 92f7478174 first 2013-03-22 15:48:27 -04:00
Kenneth Reitz 19d38d502f actually cleanup url authentication 2013-03-22 15:47:20 -04:00
Kenneth Reitz 1325409560 simplify get_auth_from_url call 2013-03-22 00:12:58 -04:00
Jamu Kakar 7d217bf9bd - Pull credentials out of the URL when possible. 2013-03-21 17:55:08 -07:00
Dmitry Medvinsky c4f9340fb4 Add ability to pass response to HTTPError()
Just a little refactoring, but it seems nicer to me to be able to pass
the response when constructing the `HTTPError` instance instead of
constructing it and then changing the member variable.
2013-03-03 10:05:42 +04:00
sprt b80f8aa475 URLError doesn't exist anymore 2013-03-01 20:20:53 +01:00
Ian Cordasco be62645dd5 Revert "If Content-Length is already set.."[1]
This reverts commit 544d08d0f6.

[1]"If Content-Length is already set, don't over ride it"
2013-02-25 09:29:05 -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
Ian Cordasco 544d08d0f6 If Content-Length is already set, don't override
Re: #1159
2013-02-01 11:58:23 -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
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