Commit Graph

114 Commits

Author SHA1 Message Date
Elias Obeid 75c57985b0 update json param's description to avoid confusion
- the Request class doesn't accept JSON, but a JSON serializable object
2018-04-30 16:50:23 +02:00
JiuLi Gao 22d12b0501 typo 2017-06-09 16:56:14 +08:00
kennethreitz e55d3d0658 fix spaces in api.py 2017-05-29 22:40:37 -04:00
Randy Barlow 3d813c9a7a Specify that the timeout parameter is in seconds.
Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
2017-05-06 21:25:50 -04:00
Ruben Dura Tari ead8fba84b Fixes DeprecationWarnings in Python 3.6 due to invalid escape sequences. Fixes #3954 2017-04-05 15:51:58 +01:00
Bastien Gérard 4207867aaf PR review fixes:
- used httpbin_secure for tests
- updated docstring related to `verify` param"
- used TLS acronym instead of SSL
2017-03-22 21:28:38 +01:00
Marcos Dione 2e9e944bc1 Removed sentence as suggested.
Fair enough...
2017-03-07 10:34:21 +01:00
Marcos Dione 16f6e25176 Add mention to list od tuples as data param.
`requests.request` accepts list of tuples in the `data` param, but thereś no mention of it in the docs.
2017-03-07 10:26:51 +01:00
Lutz Horn 3d22f9f5ab fixed #3894 by mentioning form-encoding of dict
The optional `data` parameter will be form-encoded, if a dictionary is provided.
2017-03-01 16:00:08 +01:00
Peter Inglesby 2432dd6208 Add default value of allow_redirects to docs 2017-01-12 17:00:42 +00:00
Barbara Miller eaf9a688c5 Clarify allow_redirects
Make consistent with quickstart doc.
2016-11-15 18:59:05 -08:00
hootnot 623d9e7878 documentation line added for consistency with the post method 2016-11-03 11:10:59 +01:00
Nate Prewitt 15a3869006 making module docstrings and coding comments consistent 2016-07-19 14:51:14 -06:00
Alexander Hermes b8a577050d Update docstring and API doc to document ability to add per-file headers in multipart POST
* Docstring only change - for the function itself cf. requests Issue #1640
2016-03-29 11:57:47 +01:00
Brian Samek 9a20afd6b5 Refactor default params
Specified the default argument for params that have a default in the docstring
so that the default is easier to see from the code. Modified the docstring in
api.py to match the docstring in sessions.py.
2015-12-11 13:32:09 -05:00
Artur Siekielski 1ced0040bd Assure session is closed on exception. 2015-11-06 21:54:43 +01:00
Lukas Graf f40bd0f707 Docs: Fix links to timeouts section by using :ref: instead of
linking to .html files.
2015-08-15 12:03:05 +02:00
Matt Havard 6e9ebc06d1 Make docstring of api.get more clear 2015-04-30 23:54:34 -04:00
Ulrich Petri 573d460aa7 Add return type field to entry-point docstrings
Fixes: #2483
2015-03-14 10:49:32 +01:00
Ian Cordasco 3155bc9936 Close sessions created in the functional API
This is related to #1882 and #1685. By calling close on the session, we
clear the PoolManager operated by the Session and close all sockets.

Fixes #1882
Partially-fixes #1685
2014-11-07 08:55:18 -06:00
kennethreitz 1e79cf6a47 Merge pull request #2258 from willingc/add-json
Add json parameter
2014-10-05 12:46:09 -04:00
Kevin Burke dfa41afd43 Document Timeout behaviour 2014-08-29 11:50:11 -07:00
Carol Willing 8f17741849 Adds json parameter for POST requests 2014-08-28 12:53:19 -07:00
Cory Benfield 81e88b70bd The timeout is in seconds. 2014-02-16 19:00:22 +00:00
Kenneth Reitz 23d8522285 Revert "[kennethreitz/requests#1208] adding a max_retries argument"
This reverts commit 796d3225dd.
2013-03-03 12:01:38 -05:00
Wilfred Hughes 796d3225dd [kennethreitz/requests#1208] adding a max_retries argument 2013-02-27 16:01:23 +00:00
Ian Cordasco a788cb7271 Missing line was allowing redirects with HEAD
Closes #1203
2013-02-20 08:57:37 -05:00
Kenneth Reitz f8e2d0e732 api docs 2012-12-23 01:44:54 -05:00
Hans Lellelid dd271782e8 Tweaked the 'data' param docs to indicate that a file-like object is also supported. 2012-12-20 09:45:06 -05:00
Kenneth Reitz 4c3b9df609 /s/prefetch/stream 2012-12-17 06:35:01 -05:00
Kenneth Reitz 4bad1285b6 nice and cleanup 2012-12-17 05:47:41 -05:00
Kenneth Reitz 4e5c4a6ab7 further remove config 2012-12-17 03:26:47 -05:00
Kenneth Reitz 8b141b326a json errors 2012-12-16 22:03:55 -05:00
Kenneth Reitz 92d57036f3 WHOOOOOOOOOOOOOOOO 2012-12-15 05:50:01 -05:00
Lyndsy Simon 710f09f806 Updates from ISC to Apache2 2012-12-05 16:19:14 -06:00
Kenneth Reitz ce595d4da7 Merge pull request #983 from jszakmeister/allow-strict
Add the ability to turn off HTTP 0.9 support.
2012-12-02 08:43:31 -08:00
John Szakmeister ed642cfb6d Add the ability to turn off HTTP 0.9 support.
While debugging an issue I discovered requests was coming back with 200
response, when it really shouldn't have.  It turns out this happened for
two reasons: the jetty server running the app was rather lame and
didn't fail the request as a Bad Request, and httplib was happy to let
malformed data through and call it success.

It turns out httplib's strict flag controls this behavior of whether or
not to validate the status line.  The underlying urllib3 supports the
concept as well.  There was a bug there to that is now fixed upstream.

The last step is exposing this through requests.  This introduces a
supports_http0.9 flag to help control this behavior.  It defaults to
to True to preserve the current behavior.   Setting it to False will
allow the underlying HTTPConnection to validate the status line.
2012-12-02 11:25:18 -05:00
Jonatan Heyman 8269ee7266 Fixed so that safe_mode works for Sessions 2012-11-23 16:48:51 +01:00
Locker537 42d0a2169e Whitespace fixes following PEP8. 2012-08-16 17:38:35 -04:00
Shivaram Lingamneni 3c0b94047c address connection leak issue from #520
* prefetch now defaults to True, ensuring that by default, sockets
  are returned to the urllib3 connection pool on request end
* sessions now have a close() method, notifying urllib3 to close pooled
  connections
* the module-level API, e.g., `requests.get('http://www.google.com')`,
  explicitly closes its session when finished

When prefetch is False, the open socket becomes part of the state of the
Response object, and it's the client's responsibility to read the whole
body, at which point the socket will be returned to the pool.
2012-08-05 21:09:13 -07:00
Arup Malakar b28673368b Issue #505: Changed the store_cookie configuration to be part of the config dict, instead of being a new argument 2012-05-23 14:12:18 -07:00
Kenneth Reitz 4cf31b0b86 authors 2012-05-16 17:09:43 -07:00
Arup Malakar c501784541 Issue #505: Allow disabling of cookie persistence/sending 2012-05-16 15:07:15 -07:00
Josh Imhoff cff70e75b7 New implementation of safe_mode. Now, we throw exceptions in models.py regardless of safe_mode. We catch those exceptions at the API level and return a blank Response. See safe_mode.py for details. 2012-05-09 14:47:29 -04:00
Ian Danforth 7b68c124d5 Sphinx throws an error if you don't escape ** in **kwargs 2012-03-18 18:09:58 -07:00
chadnickbok@gmail.com fc618aa78a Updated Requests api to accept a 'cert' argument.
This argument can be either a string, containing the path to a
pem-formatted key and certificate chain, or a tuple of (cert, key).

When supplied a tuple, the values are paths to an SSL certificate
chain file and key, respectively.
2012-03-14 17:15:29 -07:00
chadnickbok@gmail.com 82e69de44f Exposed key_file and cert_file in requests, to support https client certificates. 2012-03-14 15:57:30 -07:00
Kenneth Reitz 6f5735274b history for HEAD 3xx 2012-02-20 14:02:13 -05:00
Frank Kumro 0536e5b708 Added prefetch documentation for api 2012-01-12 22:16:31 -05:00
Shrikant Sharat Kandula 53d679edba The request method of Session class does not take a session argument. But api.request does. So, it has to be popped before you can send the whole kwargs dict to Session.request method. 2012-01-09 11:16:54 +05:30