ExAzureCore. Http. Request
(ex_azure_core v0.3.0)
Copy Markdown
Represents an HTTP request for Azure services.
Provides a normalized request structure that can be converted to Req options.
Creating a Request
request = ExAzureCore.Http.Request.new(
method: :get,
url: "/subscriptions",
headers: %{"accept" => "application/json"}
)Building Requests
request =
Request.new(method: :post, url: "/resources")
|> Request.put_header("content-type", "application/json")
|> Request.put_query("api-version", "2024-01-01")
|> Request.put_body(%{name: "example"})
Summary
Functions
Creates a new request with the given options.
Sets the request body.
Sets the body as form data and adds the content-type header.
Adds or updates a header in the request.
Merges multiple headers into the request.
Sets the body as JSON and adds the content-type header.
Adds or updates a query parameter.
Merges multiple query parameters into the request.
Converts the request to Req options.
Types
Functions
Creates a new request with the given options.
Options
:method- Required. HTTP method atom:url- Required. URL path or full URL:headers- Optional. Map of headers:body- Optional. Request body:query- Optional. Query parameters map:options- Optional. Additional Req options
Sets the request body.
Sets the body as form data and adds the content-type header.
Adds or updates a header in the request.
Header names are normalized to lowercase.
Merges multiple headers into the request.
Header names are normalized to lowercase.
Sets the body as JSON and adds the content-type header.
Adds or updates a query parameter.
Merges multiple query parameters into the request.
Converts the request to Req options.