human_requests.abstraction.http

Classes

HttpMethod

Represents an HTTP method.

URL

A dataclass containing the parsed URL components.

Module Contents

class HttpMethod(*args, **kwds)[source]

Represents an HTTP method.

GET = 'GET'[source]

Retrieves data from a server. It only reads data and does not modify it.

POST = 'POST'[source]

Submits data to a server to create a new resource. It can also be used to update existing resources.

PUT = 'PUT'[source]

Updates a existing resource on a server. It can also be used to create a new resource.

PATCH = 'PATCH'[source]

Updates a existing resource on a server. It only updates the fields that are provided in the request body.

DELETE = 'DELETE'[source]

Deletes a resource from a server.

HEAD = 'HEAD'[source]

Retrieves metadata from a server. It only reads the headers and does not return the response body.

OPTIONS = 'OPTIONS'[source]

Provides information about the HTTP methods supported by a server. It can be used for Cross-Origin Resource Sharing (CORS) request.

class URL[source]

A dataclass containing the parsed URL components.

full_url: str[source]

The full URL.

base_url: str = ''[source]

The base URL, without query parameters.

secure: bool = False[source]

Whether the URL is secure (https/wss).

protocol: str = ''[source]

The protocol of the URL.

path: str = ''[source]

The path of the URL.

domain_with_port: str = ''[source]

The domain of the URL with port.

domain: str = ''[source]

The domain of the URL.

port: int | None = None[source]

The port of the URL.

params: dict[str, list[str]][source]

A dictionary of query parameters.

__post_init__() None[source]