Relevant functional functions of the HTTP client, providing various HTTP request methods

urequests — Related functions of HTTP client

Relevant functional functions of the HTTP client, providing various HTTP request methods

Response class

urequests.Response

class urequests.Response(s)

The Response class object contains the server’s response to the HTTP request.

Methods

@headers

@headers

Returns the headers.

@content

@content

Returns the content of the response, in bytes.

json

json()

Return response json encoded content and convert to dict type.

Functions

urequests.request

urequests.request(function, url, data=None, json=None, files=None, headers={}, auth=None)

Send an HTTP request to the server.

  • function - HTTP function to use
  • url - URL to send
  • data - To append to the body of the request. If a dictionary or tuple list is provided, the form will be encoded.
  • json - json is used to attach to the body of the request.
  • files - Used for file upload, the type is 2-tuple, which defines the file name, file path and content type. As follows,{‘name’, (file directory,content-type)}
  • headers - Dictionary of headers to send.
  • auth - Auth tuple to enable Basic/Digest/Custom HTTP Auth.

urequests.head

urequests.head(url, **kw)

Send HEAD request and return Response object.

  • url - Request object URL
  • **kw - The parameters of the request function.

urequests.get

urequests.get(url, **kw)

Send GET request and return Response object.

  • url - Request object URL
  • **kw - Parameters of request function.

urequests.post

urequests.post(url, **kw)

Send POST request and return Response object.

  • url - Request object URL
  • **kw - Parameters of request function.

urequests.put

urequests.put(url, **kw)

Send PUT request and return Response object.

  • url - RRequest object URL
  • **kw - Parameters of request function.

urequests.patch

urequests.patch(url, **kw)

Send PATCH request, return Response object.

  • url - Request object URL
  • **kw - Parameters of request function.

urequests.delete

urequests.delete(url, **kw)

Send a DELETE request. Return Response object。

  • url - Request object URL
  • **kw - Parameters of request function.

On this page

urequests — Related functions of HTTP client