pyrit.common.make_request_and_raise_if_error_async

pyrit.common.make_request_and_raise_if_error_async#

async make_request_and_raise_if_error_async(endpoint_uri: str, method: str, post_type: Literal['json', 'data'] = 'json', debug: bool = False, extra_url_parameters: dict[str, str] | None = None, request_body: dict[str, object] | None = None, files: dict[str, tuple] | None = None, headers: dict[str, str] | None = None, **httpx_client_kwargs: Any | None) Response[source]#

Make a request and raise an exception if it fails.

Query parameters can be specified either: 1. In the endpoint_uri (e.g., “https://api.com/endpoint?api-version=2024-10-21”) 2. Via the extra_url_parameters dict 3. Both (extra_url_parameters will be merged with URL query parameters, with extra_url_parameters taking precedence)

Returns:

The response from the request.

Return type:

httpx.Response