summaryrefslogtreecommitdiffstats
path: root/Doc/library/http.client.rst
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] docs: module page titles should not start with a link to themselves ↵Miss Islington (bot)2024-05-081-2/+2
| | | | | | | | (GH-117099) (#118791) docs: module page titles should not start with a link to themselves (GH-117099) (cherry picked from commit bcb435ee8ff41b5ec5d879ee0b6651f146a66151) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* [3.12] Docs: align usage of versionadded/versionchanged with recommended ↵Erlend E. Aasland2024-01-231-4/+3
| | | | | | | | practice (#114409) (#114472) (cherry picked from commit 1d7bddd9612bcbaaedbc837e2936de773e855411) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* [3.12] gh-101100: Fix Sphinx warnings in `howto/urllib2.rst` and ↵Hugo van Kemenade2024-01-141-4/+6
| | | | | `library/http.client.rst` (GH-114060) (#114063) (cherry picked from commit c2808431b32fa7bc0d222d4549389f781f1a7333)
* [3.12] gh-106909: Use role :const: for referencing module constants ↵Serhiy Storchaka2023-07-211-1/+1
| | | | | (GH-106910) (GH-106956) (cherry picked from commit 4b9948617f91175783609769aa6160e5b49b9ccc)
* [3.12] gh-105626: Change the default return value of ↵Miss Islington (bot)2023-07-141-1/+1
| | | | | | | | `HTTPConnection.get_proxy_response_headers` (GH-105628) (#106738) gh-105626: Change the default return value of `HTTPConnection.get_proxy_response_headers` (GH-105628) (cherry picked from commit 490295d651d04ec3b3eff2a2cda7501191bad78a) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-94172: Update keyfile removal documentation (GH-105392) (#105402)Miss Islington (bot)2023-06-061-12/+2
| | | | | | | | | gh-94172: Update keyfile removal documentation (GH-105392) Remove the "deprecated:: 3.6" markup, since the parameters (like keyfile and certfile) got removed in Python 3.12. (cherry picked from commit 2b8e6e5712a83657333948bc387c81db02549b13) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-69152: add method get_proxy_response_headers to HTTPConnection class ↵Alexey Namyotkin2023-05-161-0/+11
| | | | | | | | | | (#104248) Add http.client.HTTPConnection method get_proxy_response_headers() - this is a followup to https://github.com/python/cpython/pull/26152 which added it as a non-public attribute. This way we don't pre-compute a headers dictionary that most users will never access. The new method is properly public and documented and triggers full proxy header parsing into a dict only when actually called. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-102327: Extend docs for "url" and "headers" parameters to ↵David Foster2023-05-091-2/+18
| | | | | | | | | | | HTTPConnection.request() Added example on how to use the HTTPConnection object for making GET request. Original issue: https://github.com/python/cpython/issues/102327 --------- Co-authored-by: Éric <earaujo@caravan.coop>
* GH-97950: Use new-style index directive ('module') (#103996)Adam Turner2023-05-041-1/+1
| | | | | | | | | | | | | | | | | * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference * Use new-style index directive ('module') - Tutorial * Uncomment module removal in pairindextypes * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference
* GH-103484: Fix redirected permanently URLs (#104001)Rafael Fontenelle2023-05-021-1/+1
| | | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* gh-66897: Upgrade HTTP CONNECT to protocol HTTP/1.1 (#8305)Michael Handler2023-04-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-22708: Upgrade HTTP CONNECT to protocol HTTP/1.1 (GH-NNNN) Use protocol HTTP/1.1 when sending HTTP CONNECT tunnelling requests; generate Host: headers if one is not already provided (required by HTTP/1.1), convert IDN domains to punycode in HTTP CONNECT requests. * Refactor tests to pass under -bb (fix ByteWarnings); missed some lines >80. * Use consistent 'tunnelling' spelling in Lib/http/client.py * Lib/test/test_httplib: Remove remnant of obsoleted test. * Use dict.copy() not copy.copy() * fix version changed * Update Lib/http/client.py Co-authored-by: bgehman <bgehman@users.noreply.github.com> * Switch to for/else: syntax, as suggested * Don't use for: else: * Sure, fine, w/e * Oops * 1nm to the left --------- Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: bgehman <bgehman@users.noreply.github.com> Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* Docs: Fix getstatus() -> getcode() typos (#101296)Hugo van Kemenade2023-02-101-1/+1
|
* gh-94172: Update docs for params removed in 3.12 (#100431)Hugo van Kemenade2022-12-281-17/+19
| | | | Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
* Minor grammar changes to http.client docs (#96221)Rohan Shah2022-10-031-2/+2
| | | Minor grammar changes
* Update http.client.rst (#24803)Géry Ogam2022-10-031-9/+8
| | | | | | | | | | | | * Update http.client.rst * Apply suggestions from code review Co-authored-by: Éric <merwok@netwok.org> * Update http.client.rst Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Senthil Kumaran <senthil@python.org>
* gh-91838: Use HTTPS links in docs for resources which redirect to HTTPS ↵Serhiy Storchaka2022-08-041-1/+1
| | | | | | | | | | (GH-95527) If an HTTP link is redirected to a same looking HTTPS link, the latter can be used directly without changes in readability and behavior. It protects from a men-in-the-middle attack. This change does not affect Python examples.
* gh-95451: Update docs for wasm32-emscripten and -wasi platforms (GH-95452)Christian Heimes2022-08-021-0/+2
| | | | | | Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Michael Droettboom <mdboom@gmail.com> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
* bpo-37363: Add audit events to the `http.client` module (GH-21321)Saiyang Gou2021-04-231-0/+4
| | | | | Add audit events to the `http.client` module Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-40968: Send http/1.1 ALPN extension (#20959)Christian Heimes2020-11-131-0/+5
| | | Signed-off-by: Christian Heimes <christian@python.org>
* fixes typos in http.client documentation (#18300)James Corbett2020-02-011-2/+2
|
* Update the URL for the requests package (GH-17006)Simon Legner2019-10-311-1/+1
| | | Change the url from docs.python-requests.org to requests.readthedocs.io
* bpo-12707: deprecate info(), geturl(), getcode() methods in favor of ↵Ashwin Ramaswami2019-09-131-0/+23
| | | | | headers, url, and status properties for HTTPResponse and addinfourl (GH-11447) Co-Authored-By: epicfaace <aramaswamis@gmail.com>
* Doc: Use walrus operator in example. (GH-15934)Julien Palard2019-09-111-4/+1
|
* bpo-35649: update http client example (GH-11441)Ashwin Ramaswami2019-09-111-2/+5
|
* bpo-37440: Enable TLS 1.3 post-handshake auth in http.client (GH-14448)Christian Heimes2019-07-011-0/+5
| | | | | | Post-handshake authentication is required for conditional client cert authentication with TLS 1.3. https://bugs.python.org/issue37440
* bpo-21257: document http.client.parse_headers (GH-11443)Ashwin Ramaswami2019-01-181-0/+19
| | | Document http.client.parse_headers
* bpo-33830: Fix an example in http.client docs for 404. (GH-7780)Xtreak2018-12-211-0/+1
|
* bpo-31945: Configurable blocksize in HTTP(S)Connection (#4279)Nir Soffer2017-11-061-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blocksize was hardcoded to 8192, preventing efficient upload when using file-like body. Add blocksize argument to __init__, so users can configure the blocksize to fit their needs. I tested this uploading data from /dev/zero to a web server dropping the received data, to test the overhead of the HTTPConnection.send() with a file-like object. Here is an example 10g upload with the default buffer size (8192): $ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/ Uploaded 10.00g in 17.53 seconds (584.00m/s) real 0m17.574s user 0m8.887s sys 0m5.971s Same with 512k blocksize: $ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/ Uploaded 10.00g in 6.60 seconds (1551.15m/s) real 0m6.641s user 0m3.426s sys 0m2.162s In real world usage the difference will be smaller, depending on the local and remote storage and the network. See https://github.com/nirs/http-bench for more info.
* bpo-30144: Import collections ABC from collections.abc rather than ↵Serhiy Storchaka2017-04-241-1/+1
| | | | collections. (#1263)
* Merge from 3.5Andrew Kuchling2016-11-091-1/+1
|\
| * Use http instead of https, due to certificate errorAndrew Kuchling2016-11-091-1/+1
| |
* | Merge from 3.5Andrew Kuchling2016-11-091-1/+1
|\ \ | |/
| * Update URL for requests documentation after IRC requestAndrew Kuchling2016-11-091-1/+1
| |
* | Issue #28022: Deprecate ssl-related arguments in favor of SSLContext.Christian Heimes2016-09-101-7/+11
| | | | | | | | | | | | | | The deprecation include manual creation of SSLSocket and certfile/keyfile (or similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib. ssl.wrap_socket() is not marked as deprecated yet.
* | [merge from 3.5] - Issue28010 - Make http.client.HTTPConnection.putrequestSenthil Kumaran2016-09-081-15/+9
|\ \ | |/ | | | | documentation consistent with the code.
| * Issue28010 - Make http.client.HTTPConnection.putrequest documentation ↵Senthil Kumaran2016-09-081-15/+9
| | | | | | | | consistent with the code.
* | Issue #12319: Always send file request bodies using chunked encodingMartin Panter2016-08-271-16/+15
| | | | | | | | | | | | | | The previous attempt to determine the file’s Content-Length gave a false positive for pipes on Windows. Also, drop the special case for sending zero-length iterable bodies.
* | Issue #12319: Support for chunked encoding of HTTP request bodiesMartin Panter2016-08-241-28/+70
|/ | | | | | | | | | | | | | | When the body object is a file, its size is no longer determined with fstat(), since that can report the wrong result (e.g. reading from a pipe). Instead, determine the size using seek(), or fall back to chunked encoding for unseekable files. Also, change the logic for detecting text files to check for TextIOBase inheritance, rather than inspecting the “mode” attribute, which may not exist (e.g. BytesIO and StringIO). The Content-Length for text files is no longer determined ahead of time, because the original logic could have been wrong depending on the codec and newline translation settings. Patch by Demian Brecht and Rolf Krahl, with a few tweaks by me.
* Correct misspellings of ISO-8859Martin Panter2016-08-101-2/+2
|
* Issue #22558: Add remaining doc links to source code for Python-coded modules.Terry Jan Reedy2016-06-111-2/+1
| | | | | Reformat header above separator line (added if missing) to a common format. Patch by Yoni Lavi.
* Issue #26553: Capitalization of HTTP, HTTPS, FTP, and URLMartin Panter2016-05-281-1/+1
| | | | Patch by Anish Shah and Aatish Neupane.
* Issue #23921: Standardized documentation whitespace formatting.Serhiy Storchaka2016-05-101-1/+1
| | | | Original patch by James Edwards.
* Issue #26499: Fixes to HTTPResponse.readline() and read1(), by Silent GhostMartin Panter2016-03-171-0/+4
|
* Closes #25910: fix dead and permanently redirected links in the docs. Thanks ↵Georg Brandl2016-02-261-1/+1
| | | | to SilentGhost for the patch.
* merge 3.4 (#24118)Benjamin Peterson2015-05-031-6/+6
|\
| * update example, since python.org is HTTPS-only now (closes #24118)Benjamin Peterson2015-05-031-6/+6
| |
* | merge 3.4 (#23989)Benjamin Peterson2015-04-201-0/+5
|\ \ | |/
| * recommend requests library (closes #23989)Benjamin Peterson2015-04-201-0/+5
| | | | | | | | Patch from Van Lindberg
* | #3566: Clean up handling of remote server disconnects.R David Murray2015-04-051-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset does two things: introduces a new RemoteDisconnected exception (that subclasses ConnectionResetError and BadStatusLine) so that a remote server disconnection can be detected by client code (and provides a better error message for debugging purposes), and ensures that the client socket is closed if a ConnectionError happens, so that the automatic re-connection code can work if the application handles the error and continues on. Tests are added that confirm that a connection is re-used or not re-used as appropriate to the various combinations of protocol version and headers. Patch by Martin Panter, reviewed by Demian Brecht. (Tweaked only slightly by me.)
* | Merge: #23539: Set Content-Length to 0 for PUT, POST, and PATCH if body is None.R David Murray2015-03-221-13/+23
|\ \ | |/