ex_swift v0.2.0 ExSwift.Request

Wrapper around Mojito library to make HTTP requests to Swift API.

Link to this section Summary

Functions

Send request to get new auth token

Get header value from response

Run request struct and return Mojito response struct

Link to this section Types

Link to this type

t()
t() :: %ExSwift.Request{
  body: String.t(),
  headers: [{String.t(), String.t()}],
  method: (atom() | String.t()) | nil,
  params: map(),
  path: String.t() | nil
}

Link to this section Functions

Link to this function

create_token(url, body)
create_token(String.t(), map()) ::
  {:ok, ExSwift.Response.t()} | {:error, any()}

Send request to get new auth token

Link to this function

get_header(map, name)
get_header(ExSwift.Response.t() | Mojito.Response.t(), String.t()) ::
  String.t() | nil

Get header value from response

Link to this function

run(request, config)
run(ExSwift.Request.t(), ExSwift.Config.t()) ::
  {:ok, ExSwift.Response.t()} | {:error, any()}

Run request struct and return Mojito response struct