Correios CEP v0.7.0 Correios.CEP.Client View Source

HTTP client for Correios API.

Link to this section Summary

Functions

Makes a HTTP request to Correios API using the given postal_code and options.

Link to this section Types

Specs

t() :: {:ok, String.t()} | {:error, any()}

Link to this section Functions

Link to this function

request(postal_code, options)

View Source

Specs

request(String.t(), keyword()) :: t()

Makes a HTTP request to Correios API using the given postal_code and options.

Examples

Correios.CEP.Client.request("54250-610", [])
{:ok, "..."}

Correios.CEP.Client.request("54250-610", [])
{:error, "..."}

Correios.CEP.Client.request("54250-610", [])
{:error, :some_error}