ivar v0.2.0 Ivar.Body

Ivar.Body manages the body content used for a request

Summary

Functions

Puts the given content for the content_type into the existing request map

Functions

put(request, content, content_type)
put(map, {map | list | binary}, atom | binary) :: map

Puts the given content for the content_type into the existing request map

Args

  • request - the map used to store the credentials, usually created via Ivar.new/2
  • content - the content for the request body
  • content_type - an atom for the type of content to put in the request body

Usage

iex> Ivar.Body.put(%{}, %{name: "value"}, :url_encoded)
%{body: {:url_encoded, {"content-type", "application/x-www-form-urlencoded"}, "name=value"}}