diff options
author | Cédric Krier <cedk@users.noreply.github.com> | 2019-02-19 16:18:50 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-02-19 16:18:50 (GMT) |
commit | beda52ed36e701e45f22903fc4d3bec0d085b25b (patch) | |
tree | e96db330072912b7dce724ffdc547291bae4758a /Doc/library/xmlrpc.client.rst | |
parent | 513e9b4425d09cb0b4889495f9b93dda341b8dd0 (diff) | |
download | cpython-beda52ed36e701e45f22903fc4d3bec0d085b25b.zip cpython-beda52ed36e701e45f22903fc4d3bec0d085b25b.tar.gz cpython-beda52ed36e701e45f22903fc4d3bec0d085b25b.tar.bz2 |
bpo-35153: Add headers parameter to xmlrpc.client.ServerProxy (GH-10308)
Allow to add HTTP headers to XML-RPC requests sent to the server.
Diffstat (limited to 'Doc/library/xmlrpc.client.rst')
-rw-r--r-- | Doc/library/xmlrpc.client.rst | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst index 27d92e3..3240381 100644 --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -34,10 +34,7 @@ between conformable Python objects and XML on the wire. .. class:: ServerProxy(uri, transport=None, encoding=None, verbose=False, \ allow_none=False, use_datetime=False, \ - use_builtin_types=False, *, context=None) - - .. versionchanged:: 3.3 - The *use_builtin_types* flag was added. + use_builtin_types=False, *, headers=(), context=None) A :class:`ServerProxy` instance is an object that manages communication with a remote XML-RPC server. The required first argument is a URI (Uniform Resource @@ -59,9 +56,18 @@ between conformable Python objects and XML on the wire. presented as :class:`bytes` objects; this flag is false by default. :class:`datetime.datetime`, :class:`bytes` and :class:`bytearray` objects may be passed to calls. + The *headers* parameter is an optional sequence of HTTP headers to send with + each request, expressed as a sequence of 2-tuples representing the header + name and value. (e.g. `[('Header-Name', 'value')]`). The obsolete *use_datetime* flag is similar to *use_builtin_types* but it applies only to date/time values. +.. versionchanged:: 3.3 + The *use_builtin_types* flag was added. + +.. versionchanged:: 3.8 + The *headers* parameter was added. + Both the HTTP and HTTPS transports support the URL syntax extension for HTTP Basic Authentication: ``http://user:pass@host:port/path``. The ``user:pass`` portion will be base64-encoded as an HTTP 'Authorization' header, and sent to |