usps v0.1.0 Usps.Client behaviour View Source

Behaviour for HTTP clients.

The default Usps.Client.Hackney client can be replaced by defining a module that implements the callbacks defined in this module.

Link to this section Summary

Callbacks

Makes a GET request to the given url.

Link to this section Types

Link to this type

error()

View Source
error() :: {:error, %{reason: any()}}
Link to this type

success()

View Source
success() :: {:ok, %{status_code: integer(), headers: keyword(), body: any()}}

Link to this section Callbacks

Link to this callback

request(url)

View Source
request(url :: binary()) :: success() | error()

Makes a GET request to the given url.