HTTP Client

class atproto_client.request.AsyncRequest

Bases: RequestBase

Class for handling requests errors and working with httpx.

async close() None
async get(*args: Any, **kwargs: Any) Response
async post(*args: Any, **kwargs: Any) Response
class atproto_client.request.Request

Bases: RequestBase

Class for handling requests errors and working with httpx.

close() None
get(*args: Any, **kwargs: Any) Response
post(*args: Any, **kwargs: Any) Response
class atproto_client.request.RequestBase

Bases: object

add_additional_header(header_name: str, header_value: str) None

Add additional headers for the request.

Note

This method overrides the existing header with the same name.

Parameters:
  • header_name – Header name.

  • header_value – Header value.

clone() Self

Clone the client instance.

Used to customize atproto proxy and set of labeler services.

Returns:

Cloned client instance.

get_headers(additional_headers: Dict[str, str] | None = None) Dict[str, str]

Get headers for the request.

Parameters:

additional_headers – Additional headers.

Returns:

Headers for the request.

set_additional_headers(headers: Dict[str, str]) None

Set additional headers for the request.

Parameters:

headers – Additional headers.

class atproto_client.request.Response(success: bool, status_code: int, content: Union[Dict[str, Any], bytes, ForwardRef('XrpcError'), NoneType], headers: Dict[str, Any])

Bases: object

content: Dict[str, Any] | bytes | XrpcError | None
headers: Dict[str, Any]
status_code: int
success: bool