DSLModule
PackageAxial.HttpClient
Summary
| Name | Signature | Synopsis |
|---|---|---|
| Operations | ||
| secret | secret value | Marks an interpolated URL value for diagnostic redaction. |
| GET | GET template | Creates a GET request from an interpolated URL. |
| HEAD | HEAD template | Creates a HEAD request from an interpolated URL with encoded holes. |
| POST | POST template | Creates a POST request from an interpolated URL with encoded holes. |
| PUT | PUT template | Creates a PUT request from an interpolated URL with encoded holes. |
| PATCH | PATCH template | Creates a PATCH request from an interpolated URL with encoded holes. |
| DELETE | DELETE template | Creates a DELETE request from an interpolated URL with encoded holes. |
| query | query name value request | Appends a URL-encoded query parameter. |
| secretQuery | secretQuery name value request | Appends a redacted query parameter. |
| header | header name value request | Appends one request header. |
| bearer | bearer token request | Adds a redacted bearer-token Authorization header. |
| basicAuth | basicAuth user password request | Adds a redacted basic-auth Authorization header. |
| timeout | timeout value request | Sets a per-request timeout. |
| jsonBody | jsonBody json request | Sends an already-serialized JSON body. |
| jsonBodyOf | jsonBodyOf encode value request | Encodes and sends a JSON body. |
| textBody | textBody content request | Sends a plain-text body. |
| formBody | formBody fields request | Sends URL-encoded form fields. |
| expect | expect statuses request | Replaces the statuses treated as success. |
| expectAny | expectAny request | Treats every status as success. |
| fetch | fetch request | Sends the request and returns the full transcript, failing on unexpected statuses. |
| fetchText | fetchText request | Sends the request and returns the body text. |
| fetchBytes | fetchBytes request | Sends the request and returns the body bytes. |
| fetchJson | fetchJson decode request | Sends the request and decodes the JSON response. |
| withRetries | withRetries maxAttempts workflow | Retries transient failures with exponential backoff. |
Operations
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
kind:member
Sends the request and decodes the JSON response.
<example><code>GET $"{root}/users/{id}" |> fetchJson (Json.deserializeResult codec)</code></example>
Parameters
| Name | Type | Description |
|---|---|---|
| decode | string -> Result<'a, string> | |
| request | HttpRequest |
Returns
Flow<'b, HttpError, 'a>
kind:member
Retries transient failures with exponential backoff.
<example><code>GET $"{root}/users" |> fetchJson decode |> withRetries 4</code></example>
Parameters
| Name | Type | Description |
|---|---|---|
| maxAttempts | int | |
| workflow | Flow<'a, HttpError, 'b> |
Returns
Flow<'a, HttpError, 'b>

