human_requests.abstraction¶
Submodules¶
Classes¶
A dataclass containing the parsed URL components. |
|
Represents an HTTP method. |
|
Универсальный класс для работы с прокси в двух форматах: |
|
Represents all the data passed in the request. |
|
Represents the response of a request. |
Package Contents¶
- class HttpMethod(*args, **kwds)[source]¶
Represents an HTTP method.
- GET = 'GET'¶
Retrieves data from a server. It only reads data and does not modify it.
- POST = 'POST'¶
Submits data to a server to create a new resource. It can also be used to update existing resources.
- PUT = 'PUT'¶
Updates a existing resource on a server. It can also be used to create a new resource.
- PATCH = 'PATCH'¶
Updates a existing resource on a server. It only updates the fields that are provided in the request body.
- DELETE = 'DELETE'¶
Deletes a resource from a server.
- HEAD = 'HEAD'¶
Retrieves metadata from a server. It only reads the headers and does not return the response body.
- OPTIONS = 'OPTIONS'¶
Provides information about the HTTP methods supported by a server. It can be used for Cross-Origin Resource Sharing (CORS) request.
- class Proxy(
- proxy: str | Dict[str, Any] | None = None,
- *,
- server: str | None = None,
- username: str | None = None,
- password: str | None = None,
Универсальный класс для работы с прокси в двух форматах: 1. Строковый: ‘http://user:pass@host:port’ или ‘socks5://host:port’ 2. Playwright dict: {
‘server’: ‘http://host:port’, ‘username’: ‘user’, ‘password’: ‘pass’
}
- class FetchRequest[source]¶
Represents all the data passed in the request.
- method: HttpMethod¶
The method used in the request.
- class FetchResponse[source]¶
Represents the response of a request.
- request: FetchRequest¶
The request that was made.
- type: Literal['basic', 'cors', 'error', 'opaque', 'opaqueredirect']¶
- async render(
- retry: int = 2,
- timeout: float | None = None,
- wait_until: Literal['commit', 'load', 'domcontentloaded', 'networkidle'] = 'commit',
- referer: str | None = None,
Renders the response content in the current browser. It will look like we requested it through the browser from the beginning.
Recommended to use in cases when the server returns a JS challenge instead of a response.