exhal v4.2.1 ExHal.Navigation

Summary

Functions

Follows all links of a particular rel in a HAL document

Returns {:ok, url} if a matching link is found or {:error, %ExHal.Error{...}} if not

Posts data to the named link in a HAL document

PUTs data to the named link in a HAL document

Functions

follow_link(a_doc, name, opts \\ %{tmpl_vars: %{}, strict: false, headers: []})

Follows a link in a HAL document.

Returns {:ok, %ExHal.Document{...}} if response is successful; {:error, %ExHal.Error{...}} if not

follow_links(a_doc, name)
follow_links(a_doc, name, opts)

Follows all links of a particular rel in a HAL document.

Returns [{:ok, %ExHal.Document{...}}, {:error, %ExHal.Error{...}, ...]

follow_links(a_doc, name, missing_link_handler, opts \\ %{})
post(a_doc, name, body, opts \\ %{tmpl_vars: %{}, strict: true})

Posts data to the named link in a HAL document.

Returns {:ok, %ExHal.Document{...}} if response is successful and body is HAL; {:error, %ExHal.Error{...}} if response is an error if not

put(a_doc, name, body, opts \\ %{tmpl_vars: %{}, strict: true})

PUTs data to the named link in a HAL document.

Returns {:ok, %ExHal.Document{...}} if response is successful and body is HAL; {:error, %ExHal.Error{...}} if response is an error if not