Http Client
HTTP client for connector operations with retry and authentication.
Classes
ConnectorResponse
Bases: Generic[T]
Represents a response from a connector operation.
Initialize a ConnectorResponse.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status_code
|
int
|
The HTTP status code. |
required |
headers
|
Dict[str, str]
|
The response headers. |
required |
value
|
Optional[T]
|
The response value. |
required |
ConnectorHttpClient
HTTP client for connector operations with retry and authentication.
Initialize a ConnectorHttpClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_provider
|
TokenProvider
|
The token provider for authentication. |
required |
options
|
ConnectorClientOptions
|
The client options. |
required |
Methods:
send_async
async
send_async(method: str, url: str, scopes: Optional[List[str]] = None, body: Optional[Any] = None, content_type: Optional[str] = None) -> _ResponseSnapshot
Send an HTTP request with authentication and retry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
The HTTP method. GET, HEAD, OPTIONS, and TRACE use configured retries by default. Other methods require the explicit per-client retry_unsafe_http_methods opt-in to retry. |
required |
url
|
str
|
The request URL. |
required |
scopes
|
Optional[List[str]]
|
The authentication scopes. Defaults to API Hub scopes. |
None
|
body
|
Optional[Any]
|
Optional request body. Raw |
None
|
content_type
|
Optional[str]
|
Optional Content-Type header value. Defaults to
|
None
|
Returns:
| Type | Description |
|---|---|
_ResponseSnapshot
|
The HTTP response. |
get_async
async
Send a GET request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_uri
|
str
|
The request URI. |
required |
scopes
|
Optional[List[str]]
|
Optional authentication scopes. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The deserialized response. |
post_async
async
Send a POST request with JSON body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_uri
|
str
|
The request URI. |
required |
body
|
Any
|
The request body. |
required |
scopes
|
Optional[List[str]]
|
Optional authentication scopes. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The deserialized response. |