ExAzureCore. Http. Response
(ex_azure_core v0.2.0)
Copy Markdown
Represents an HTTP response from Azure services.
Provides normalized access to response data with helper functions for common status code checks and header access.
Creating from Req Response
{:ok, req_response} = Req.request(opts)
response = ExAzureCore.Http.Response.from_req(req_response)Checking Status
if Response.success?(response) do
process(response.body)
end
Summary
Functions
Returns true if the response has a 4xx status code.
Gets the Content-Type header value.
Creates a Response from a Req.Response struct.
Gets a header value by name (case-insensitive).
Gets the Retry-After header value as an integer (seconds).
Returns true if the response is rate limited (429).
Returns true if the response is a redirect (3xx).
Returns true if the response has a 5xx status code.
Returns true if the response has a 2xx status code.
Types
Functions
Returns true if the response has a 4xx status code.
Gets the Content-Type header value.
@spec from_req(Req.Response.t()) :: t()
Creates a Response from a Req.Response struct.
Gets a header value by name (case-insensitive).
Returns nil if the header is not present.
@spec get_retry_after(t()) :: non_neg_integer() | nil
Gets the Retry-After header value as an integer (seconds).
Returns nil if the header is not present or cannot be parsed. Azure services return Retry-After as seconds.
Returns true if the response is rate limited (429).
Returns true if the response is a redirect (3xx).
Returns true if the response has a 5xx status code.
Returns true if the response has a 2xx status code.