Skip to content

Http Client

Asynchronous HTTP client for connector operations.

Classes

ConnectorResponse

ConnectorResponse(status_code: int, headers: Dict[str, str], value: Optional[ResponseT])

Bases: Generic[ResponseT]

Represent a response from a connector operation.

Initialize the response.

Attributes

is_success_status_code property
is_success_status_code: bool

Check whether the response indicates success.

ConnectorHttpClient

ConnectorHttpClient(credential: AsyncTokenCredential | AzureKeyCredential, *, max_retry_attempts: int = 3, timeout_seconds: float = 30.0, use_exponential_backoff: bool = True, initial_retry_delay_seconds: float = 0.5, maximum_retry_delay_seconds: float = 120.0, retry_jitter_factor: float = 0.1, retry_unsafe_http_methods: bool = False, transport: Optional[AsyncHttpTransport] = None, **kwargs: Any)

Asynchronous HTTP client with Azure Core policies.

Initialize the HTTP client.

Methods:

close async
close() -> None

Close the HTTP transport without closing the caller credential.

send async
send(method: str, url: str, body: Optional[Any] = None, content_type: Optional[str] = None, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> ConnectorResponseSnapshot

Send an HTTP request within the selected total network timeout.

get async
get(request_uri: str) -> Any

Send a GET request.

post async
post(request_uri: str, body: Any) -> Any

Send a POST request with a JSON body.