Statifier.Send.BasicHTTP.Transport.Httpc (Statifier v2.10.0)

Copy Markdown View Source

The default Statifier.Send.BasicHTTP.Transport, on OTP's :httpc (ADR-0075 decision 6). No dependency: :inets, :ssl and :public_key ship with OTP.

This package's application list names none of them, so a host that registers nothing starts nothing. The adapter starts :inets and :ssl itself on its first POST, and checks that :ssl and :public_key can be loaded; when they cannot, the POST answers {:error, reason} and the processor reports the miss.

For an https URL it verifies the peer (verify: :verify_peer) against the system CA store (:public_key.cacerts_get/0) and checks the host name. Each request is bounded by a five-second connect timeout and a five-second request timeout, so a slow location holds the sending session no longer than that.

Summary

Functions

POSTs body with headers to url through :httpc, once (see Statifier.Send.BasicHTTP.Transport.post/3).

Functions

post(url, headers, body)

@spec post(url :: String.t(), headers :: [{String.t(), String.t()}], body :: binary()) ::
  {:ok, 100..599} | {:error, term()}

POSTs body with headers to url through :httpc, once (see Statifier.Send.BasicHTTP.Transport.post/3).