Oneflow v0.2.0 Oneflow.Http.Request

Link to this section Summary

Functions

Oneflow api excpect request’s content-type to be json. This function encodes the body with poison

Given a method and a path instantiates a oneflow request

Link to this section Functions

Oneflow api excpect request’s content-type to be json. This function encodes the body with poison.

Examples

iex> alias Oneflow.Http.Request iex> request = Request.new(:get, “/shipments”, %{}, %{“key” => “value”}) iex> Request.body(request) “{\”key\”:\”value\”}”

Link to this function new(method, path, params \\ %{}, payload \\ %{}, opts \\ [])
new(atom(), String.t(), String.t(), List.t(), List.t()) ::
  %Oneflow.Http.Request{
    body: term(),
    method: term(),
    opts: term(),
    params: term(),
    path: term()
  }

Given a method and a path instantiates a oneflow request.

Examples

iex> alias Oneflow.Http.Request iex> Request.new(:get, “/shipments”) %Oneflow.Http.Request{body: %{}, method: :get, opts: [], params: %{}, path: “/shipments”}