MCPcopy
hub / github.com/arduino/Arduino / request

Function request

arduino-core/src/processing/app/i18n/python/requests/api.py:17–44  ·  view source on GitHub ↗

Constructs and sends a :class:`Request `. Returns :class:`Response ` object. :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query strin

(method, url, **kwargs)

Source from the content-addressed store, hash-verified

15
16
17def request(method, url, **kwargs):
18 """Constructs and sends a :class:`Request <Request>`.
19 Returns :class:`Response <Response>` object.
20
21 :param method: method for the new :class:`Request` object.
22 :param url: URL for the new :class:`Request` object.
23 :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
24 :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
25 :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.
26 :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.
27 :param files: (optional) Dictionary of 'name': file-like-objects (or {'name': ('filename', fileobj)}) for multipart encoding upload.
28 :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.
29 :param timeout: (optional) Float describing the timeout of the request.
30 :param allow_redirects: (optional) Boolean. Set to True if POST/PUT/DELETE redirect following is allowed.
31 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.
32 :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.
33 :param stream: (optional) if ``False``, the response content will be immediately downloaded.
34 :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
35
36 Usage::
37
38 >>> import requests
39 >>> req = requests.request('GET', 'http://httpbin.org/get')
40 <Response [200]>
41 """
42
43 session = sessions.Session()
44 return session.request(method=method, url=url, **kwargs)
45
46
47def get(url, **kwargs):

Callers 7

getFunction · 0.85
optionsFunction · 0.85
headFunction · 0.85
postFunction · 0.85
putFunction · 0.85
patchFunction · 0.85
deleteFunction · 0.85

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected