1 def request(method, url, **kwargs):
2 """Constructs and sends a :class:`Request <Request>`.
3
4 :param method: method for the new :class:`Request` object.
5 :param url: URL for the new :class:`Request` object.
6 :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
7 :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
8 :param json: (optional) json data to send in the body of the :class:`Request`.
9 :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.
10 :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.
11 :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload.
12 ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')``
13 or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string
14 defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers
15 to add for the file.
16 :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.
17 :param timeout: (optional) How long to wait for the server to send data
18 before giving up, as a float, or a :ref:`(connect timeout, read
19 timeout) <timeouts>` tuple.
20 :type timeout: float or tuple
21 :param allow_redirects: (optional) Boolean. Set to True if POST/PUT/DELETE redirect following is allowed.
22 :type allow_redirects: bool
23 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.
24 :param verify: (optional) whether the SSL cert will be verified. A CA_BUNDLE path can also be provided. Defaults to ``True``.
25 :param stream: (optional) if ``False``, the response content will be immediately downloaded.
26 :param cert: (optional) if String, path to ssl client cert