A convenience, top-level request method. It uses a module-globalPoolManager instance.Therefore, its side effects could be shared across dependencies relying on it.To avoid side effects create a newPoolManager instance and use it instead.The method does not accept low-level**urlopen_kw keyword arguments.
method (str) – HTTP request method (such as GET, POST, PUT, etc.)
url (str) – The URL to perform the request on.
body (bytes |IO[Any]|Iterable[bytes]|str |None) – Data to send in the request body, eitherstr,bytes,an iterable ofstr/bytes, or a file-like object.
fields (Sequence[tuple[str,str |bytes |tuple[str,str |bytes]|tuple[str,str |bytes,str]]|RequestField]|Mapping[str,str |bytes |tuple[str,str |bytes]|tuple[str,str |bytes,str]]|None) – Data to encode and send in the request body.
headers (Mapping[str,str]|None) – Dictionary of custom headers to send, such as User-Agent,If-None-Match, etc.
preload_content (bool) – If True, the response’s body will be preloaded into memory.
decode_content (bool) – If True, will attempt to decode the body based on the‘content-encoding’ header.
redirect (bool |None) – If True, automatically handle redirects (status codes 301, 302,303, 307, 308). Each redirect counts as a retry. Disabling retrieswill disable redirect, too.
retries (Retry, False, or an int.) –
Configure the number of retries to allow before raising aMaxRetryError exception.
IfNone (default) will retry 3 times, seeRetry.DEFAULT. Pass aRetry object for fine-grained controlover different types of retries.Pass an integer number to retry connection errors that many times,but no other types of errors. Pass zero to never retry.
IfFalse, then retries are disabled and any exception is raisedimmediately. Also, instead of raising a MaxRetryError on redirects,the redirect response will be returned.
timeout (Timeout |float |int |None) – If specified, overrides the default timeout for this onerequest. It may be a float (in seconds) or an instance ofurllib3.util.Timeout.
json (Any |None) – Data to encode and send as JSON with UTF-encoded in the request body.The"Content-Type" header will be set to"application/json"unless specified otherwise.