March Docs

HttpClient

HttpClient: high-level composable HTTP client with step pipeline.

This is Layer 3 of March's HTTP library. It provides a Req-style three-phase pipeline (request steps, response steps, error steps) built on top of HttpTransport.

Usage: let client = HttpClient.new_client() |> HttpClient.add_request_step("auth", HttpClient.Steps.bearer_auth("my-token")) |> HttpClient.with_redirects(5) let resp = HttpClient.get(client, "http://api.example.com/users")

Types

typeTransportErrorTransportError =#
typeHttpErrorHttpError =#
typeRequestStepEntryRequestStepEntry = RequestStepEntry(String, a)#
typeResponseStepEntryResponseStepEntry = ResponseStepEntry(String, a)#
typeErrorRecoveryErrorRecovery = Recover(a) | Fail(HttpError)#
typeErrorStepEntryErrorStepEntry = ErrorStepEntry(String, a)#
typeClientClient = Client(#