sdkagent

urllib3 API reference

89 public APIs from urllib3 (urllib3/urllib3) — 34 classes, 34 functions, 21 methods. Signatures extracted by static analysis of the actual source.

Repository: urllib3/urllib3

KindCount
Classes34
Functions34
Methods21

API list

funcdummyserver.app.alpn_protocol() -> ResponseReturnValue
Return the requester's certificate.
funcdummyserver.app.certificate() -> ResponseReturnValue
Return the requester's certificate.
funcdummyserver.app.echo() -> ResponseReturnValue
Echo back the params
funcdummyserver.app.echo_json() -> ResponseReturnValue
Echo back the JSON
funcdummyserver.app.echo_params() -> ResponseReturnValue
Echo back the query parameters
funcdummyserver.app.echo_uri(rest:str) -> ResponseReturnValue
Echo back the requested URI
funcdummyserver.app.encodingrequest() -> ResponseReturnValue
Check for UA accepting gzip/deflate encoding
funcdummyserver.app.multi_redirect() -> ResponseReturnValue
Performs a redirect chain based on ``redirect_codes``
funcdummyserver.app.redirect() -> ResponseReturnValue
Perform a redirect to ``target``
funcdummyserver.app.redirect_after() -> ResponseReturnValue
Perform a redirect to ``target``
funcdummyserver.app.source_address() -> ResponseReturnValue
Return the requester's IP address.
funcdummyserver.app.specific_method() -> ResponseReturnValue
Confirm that the request matches the desired method type
funcdummyserver.app.upload() -> ResponseReturnValue
Confirm that the uploaded file conforms to specification
classdummyserver.socketserver.NoIPv6Warning
IPv6 is not available
methoddummyserver.testcase.ConnectionMarker.consume_request(sock:socket.socket, chunks:int=65536) -> bytearray
Consume a socket until after the HTTP request is sent.
methoddummyserver.testcase.ConnectionMarker.mark(monkeypatch:pytest.MonkeyPatch) -> typing.Generator[None]
Mark connections under in that context.
classsrc.urllib3._collections.HTTPHeaderDict
:param headers: An iterable of field-value pairs.
methodsrc.urllib3._collections.HTTPHeaderDict.extend(*args:ValidHTTPHeaderSource, **kwargs:str) -> None
Generic import function for any type of header-like object.
funcsrc.urllib3.add_stderr_logger(level:int=logging.DEBUG) -> logging.StreamHandler[typing.TextIO]
Helper for quickly adding a StreamHandler to the logger.
classsrc.urllib3.connection.DummyConnection
Used to detect a failed ConnectionCls import.
methodsrc.urllib3.connection.HTTPConnection.getresponse() -> HTTPResponse
Get the response from the server.
methodsrc.urllib3.connectionpool.ConnectionPool.close() -> None
Close all pooled connections and disable the pool.
classsrc.urllib3.connectionpool.HTTPConnectionPool
Thread-safe connection pool for one host.
methodsrc.urllib3.connectionpool.HTTPConnectionPool.close() -> None
Close all pooled connections and disable the pool.
classsrc.urllib3.connectionpool.HTTPSConnectionPool
Same as :class:`.HTTPConnectionPool`, but HTTPS.
funcsrc.urllib3.contrib.emscripten.fetch.has_jspi() -> bool
Return true if jspi can be used.
funcsrc.urllib3.contrib.pyopenssl.extract_from_urllib3() -> None
Undo monkey-patching by :func:`inject_into_urllib3`.
funcsrc.urllib3.contrib.pyopenssl.idna_encode(name:str) -> bytes | None
Borrowed wholesale from the Python Cryptography Project.
funcsrc.urllib3.disable_warnings(category:type[Warning]=exceptions.HTTPWarning) -> None
Helper for quickly disabling all urllib3 warnings.
classsrc.urllib3.exceptions.DecodeError
Raised when automatic decoding based on Content-Type fails.
classsrc.urllib3.exceptions.HTTPError
Base exception used by this module.
classsrc.urllib3.exceptions.HTTPWarning
Base warning used by this module.
classsrc.urllib3.exceptions.InsecureRequestWarning
Warned when making an unverified HTTPS request.
classsrc.urllib3.exceptions.InvalidChunkLength
Invalid chunk length in a chunked response.
classsrc.urllib3.exceptions.InvalidHeader
The header provided was somehow invalid.
classsrc.urllib3.exceptions.LocationValueError
Raised when there is something wrong with a given URL input.
classsrc.urllib3.exceptions.MaxRetryError
Raised when the maximum number of retries is exceeded.
classsrc.urllib3.exceptions.NameResolutionError
Raised when host name resolution fails.
classsrc.urllib3.exceptions.NewConnectionError
Raised when we fail to establish a new connection.
classsrc.urllib3.exceptions.NotOpenSSLWarning
Warned when using unsupported SSL library
classsrc.urllib3.exceptions.PoolError
Base exception for errors caused within a pool.
classsrc.urllib3.exceptions.ProtocolError
Raised when something unexpected happens mid-request/response.
classsrc.urllib3.exceptions.ProxyError
Raised when the connection to a proxy fails.
classsrc.urllib3.exceptions.ProxySchemeUnknown
ProxyManager does not support the supplied scheme
classsrc.urllib3.exceptions.RequestError
Base exception for PoolErrors that have associated URLs.
classsrc.urllib3.exceptions.ResponseNotChunked
Response needs to be chunked in order to read it as chunks.
classsrc.urllib3.exceptions.SSLError
Raised when SSL certificate fails in an HTTPS connection.
classsrc.urllib3.exceptions.SecurityWarning
Warned when performing security reducing actions
classsrc.urllib3.exceptions.SystemTimeWarning
Warned when system time is suspected to be wrong
classsrc.urllib3.exceptions.TimeoutError
Raised when a socket timeout error occurs.
classsrc.urllib3.exceptions.TimeoutStateError
Raised when passing an invalid state to a timeout
classsrc.urllib3.exceptions.URLSchemeUnknown
Raised when a URL input has an unsupported scheme.
classsrc.urllib3.exceptions.UnrewindableBodyError
urllib3 encountered an error when trying to rewind a body
classsrc.urllib3.fields.RequestField
A data container for request body parameters.
methodsrc.urllib3.fields.RequestField.render_headers() -> str
Renders the headers for this request field.
funcsrc.urllib3.fields.format_header_param(name:str, value:_TYPE_FIELD_VALUE) -> str
..
funcsrc.urllib3.fields.format_header_param_html5(name:str, value:_TYPE_FIELD_VALUE) -> str
..
funcsrc.urllib3.fields.format_multipart_header_param(name:str, value:_TYPE_FIELD_VALUE) -> str
Format and quote a single multipart header parameter.
funcsrc.urllib3.fields.guess_content_type(filename:str | None, default:str='application/octet-stream') -> str
Guess the "Content-Type" of a file.
funcsrc.urllib3.filepost.iter_field_objects(fields:_TYPE_FIELDS) -> typing.Iterable[RequestField]
Iterate over fields.
classsrc.urllib3.response.HTTPResponse
HTTP Response container.
methodsrc.urllib3.response.HTTPResponse.stream(amt:int | None=_READ_CHUNK_SIZE, decode_content:bool | None=None) -> typing.Generator[bytes]
A generator wrapper for the read() method.
methodsrc.urllib3.response.HTTPResponse.tell() -> int
Obtain the number of bytes pulled over the wire so far.
methodsrc.urllib3.response.HTTPResponse.url() -> str | None
Returns the URL that was the source of this response.
funcsrc.urllib3.util.connection.is_connection_dropped(conn:BaseHTTPConnection) -> bool
Returns True if the connection is dropped and should be closed.
funcsrc.urllib3.util.request.rewind_body(body:typing.IO[typing.AnyStr], body_pos:_TYPE_BODY_POSITION) -> None
Attempt to rewind body to a certain position.
funcsrc.urllib3.util.request.set_file_position(body:typing.Any, pos:_TYPE_BODY_POSITION | None) -> _TYPE_BODY_POSITION | None
If a position is provided, move file to that point.
funcsrc.urllib3.util.response.assert_header_parsing(headers:httplib.HTTPMessage) -> None
Asserts whether all headers have been successfully parsed.
funcsrc.urllib3.util.response.is_fp_closed(obj:object) -> bool
Checks whether a given file-like object is closed.
classsrc.urllib3.util.retry.Retry
Retry configuration.
methodsrc.urllib3.util.retry.Retry.get_backoff_time() -> float
Formula for computing the current backoff :rtype: float
methodsrc.urllib3.util.retry.Retry.get_retry_after(response:BaseHTTPResponse) -> float | None
Get the value of Retry-After in seconds.
methodsrc.urllib3.util.retry.Retry.is_exhausted() -> bool
Are we out of retries?
methodsrc.urllib3.util.retry.Retry.is_retry(method:str, status_code:int, has_retry_after:bool=False) -> bool
Is this method/status code retryable?
methodsrc.urllib3.util.retry.Retry.sleep(response:BaseHTTPResponse | None=None) -> None
Sleep between retry attempts.
funcsrc.urllib3.util.ssl_.assert_fingerprint(cert:bytes | None, fingerprint:str) -> None
Checks if given fingerprint matches the supplied certificate.
funcsrc.urllib3.util.ssl_.is_ipaddress(hostname:str | bytes) -> bool
Detects whether the hostname given is an IPv4 or IPv6 address.
funcsrc.urllib3.util.ssl_.resolve_ssl_version(candidate:None | int | str) -> int
like resolve_cert_reqs
classsrc.urllib3.util.timeout.Timeout
Timeout configuration.
methodsrc.urllib3.util.timeout.Timeout.from_float(timeout:_TYPE_TIMEOUT) -> Timeout
Create a new Timeout from a legacy timeout value.
methodsrc.urllib3.util.timeout.Timeout.read_timeout() -> float | None
Get the value for the read timeout.
classsrc.urllib3.util.url.Url
Data structure for representing an HTTP URL.
methodsrc.urllib3.util.url.Url.authority() -> str | None
Authority component as defined in RFC 3986 3.2.
methodsrc.urllib3.util.url.Url.hostname() -> str | None
For backwards-compatibility with urlparse.
methodsrc.urllib3.util.url.Url.netloc() -> str | None
Network location including host and port.
methodsrc.urllib3.util.url.Url.request_uri() -> str
Absolute path including the query string.
funcsrc.urllib3.util.url.parse_url(url:str) -> Url
Given a url, return a parsed :class:`.Url` namedtuple.
funcsrc.urllib3.util.wait.wait_for_read(sock:socket.socket, timeout:float | None=None) -> bool
Waits for reading to be available on a given socket.
funcsrc.urllib3.util.wait.wait_for_write(sock:socket.socket, timeout:float | None=None) -> bool
Waits for writing to be available on a given socket.

About this data

These signatures were extracted from the public source of urllib3/urllib3 using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries