sasvi.custom
Low-level requester for custom SVI extension endpoints.
Exposes CustomEndpointClient, a thin authenticated wrapper over the
retrying HTTPX transport for calling endpoints the typed service layer does not
cover. It reuses the client's auth, retry, and response-size guards, and keeps
requests locked to the configured base-URL origin unless the caller explicitly
opts out with allow_external_auth=True.
CustomEndpointClient Objects
class CustomEndpointClient()
Low-level requester for custom extension endpoints.
request
def request(method: str,
path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
files: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False,
**kwargs: Any) -> httpx2.Response
Send an authenticated custom endpoint request.
Arguments:
method- HTTP method, for example"GET"or"POST".path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.files- Multipart file payload, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.**kwargs- Other keyword arguments passed unchanged tohttpx2.Client.request.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
request_async
async def request_async(method: str,
path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
files: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False,
**kwargs: Any) -> httpx2.Response
Send an authenticated custom endpoint request asynchronously.
Arguments:
method- HTTP method, for example"GET"or"POST".path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.files- Multipart file payload, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.**kwargs- Other keyword arguments passed unchanged tohttpx2.AsyncClient.request.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
get
def get(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated GET request and return the raw response.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
post
def post(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
files: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated POST request and return the raw response.
Use json for JSON bodies, data for form or raw data, files
for multipart uploads, or content for explicit raw content.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.files- Multipart file payload, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
put
def put(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
files: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated PUT request and return the raw response.
Use this for full-resource replacement endpoints that expect JSON, form data, multipart files, or raw content.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.files- Multipart file payload, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
patch
def patch(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
files: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated PATCH request and return the raw response.
Use this for partial update endpoints that expect JSON, form data, multipart files, or raw content.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.files- Multipart file payload, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
delete
def delete(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated DELETE request and return the raw response.
json, data, and content are available for endpoints that
accept a request body with DELETE.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
get_async
async def get_async(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated async GET request and return the raw response.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
post_async
async def post_async(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
files: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated async POST request and return the raw response.
Use json for JSON bodies, data for form or raw data, files
for multipart uploads, or content for explicit raw content.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.files- Multipart file payload, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
put_async
async def put_async(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
files: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated async PUT request and return the raw response.
Use this for full-resource replacement endpoints that expect JSON, form data, multipart files, or raw content.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.files- Multipart file payload, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
patch_async
async def patch_async(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
files: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated async PATCH request and return the raw response.
Use this for partial update endpoints that expect JSON, form data, multipart files, or raw content.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.files- Multipart file payload, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
delete_async
async def delete_async(path: str | httpx2.URL,
*,
base_url: str | None = None,
headers: Mapping[str, str] | None = None,
params: Mapping[str, Any] | None = None,
json: Any = None,
data: Any = None,
content: Any = None,
cookies: Any = None,
follow_redirects: bool | None = None,
timeout: float | httpx2.Timeout | None = None,
extensions: Mapping[str, Any] | None = None,
allow_external_auth: bool = False) -> httpx2.Response
Send an authenticated async DELETE request and return the raw response.
json, data, and content are available for endpoints that
accept a request body with DELETE.
Arguments:
path- Absolute URL, or a path relative tobase_urlorSVIConfig.base_url. An absolute URL must usehttpsorhttpand carry no user-info.base_url- Root for a relativepath, used instead ofSVIConfig.base_url. It goes through the same normalization, so a bare host becomes HTTPS. Ignored whenpathis absolute.headers- Headers for this request, merged by HTTPX over the SDK defaults. AHostheader must name the target URL's own host and port unlessallow_external_authisTrue.params- Query parameters added to the URL.json- Request body, serialized as JSON by HTTPX.data- Form fields or raw body data, passed to HTTPX unchanged.content- Raw body asbytes, text or a byte stream.cookies- Cookies for this request. A request that sets cookies is treated as carrying a credential by the origin checks.follow_redirects- Whether to follow redirects for this request.NonekeepsSVIConfig.follow_redirects.timeout- Timeout for this request, in seconds or as anhttpx2.Timeout.NonekeepsSVIConfig.timeout.extensions- HTTPX request extensions, passed through unchanged.allow_external_auth- WhenTrue, permit a request to an origin other than the configured base URL, including one carrying SDK credentials. Defaults toFalse, so every request stays locked to the base-URL origin.
Returns:
Raw httpx2.Response. Callers own status handling and payload parsing.
Raises:
AuthConfigurationError- When the resolved URL targets an origin other thanSVIConfig.base_urlandallow_external_authisFalse, when aHostheader names another host, or when a credential-carrying request has no configured base URL to lock to.InvalidBaseURLError- When an absolutepathuses a scheme other thanhttps/httpor embeds user-info, or whenbase_urlfails normalization.NetworkError- When the request failed before a complete response arrived and retries (if any) were exhausted. Checkoutcome_unknownbefore resending a write.ServiceUnreachableError- When the service could not be reached.TLSError- When TLS negotiation or certificate validation failed.DeadlineExceededError- Whenrequest_deadline_secondselapsed.ResponseTooLargeError- When the response declares a body aboveSVIConfig.max_response_bytes.
close
def close() -> None
Close the underlying synchronous HTTP client and release resources.
A connection pool shared with the owning SVIClient stays open; that
client closes it.
close_async
async def close_async() -> None
Close the underlying asynchronous HTTP client and release resources.