exhal v8.2.0 ExHal.Navigation
Link to this section Summary
Functions
Follows a link in a HAL document.
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.
Returns {:ok, [url1, ...]}
if a matching link is found or {:error, %ExHal.Error{...}}
if not.
PATCHs data to the named link in a HAL document.
Posts data to the named link in a HAL document.
PUTs data to the named link in a HAL document.
Link to this section Functions
follow_link(a_doc, name, opts \\ %{tmpl_vars: %{}, strict: false, headers: []})
Follows a link in a HAL document.
Returns {:ok, %ExHal.Document{...}, %ExHal.ResponseHeader{...}}
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{...}, %ExHal.ResponseHeader{...}}, {:error, %ExHal.Error{...}, ...]
follow_links(a_doc, name, missing_link_handler, opts \\ %{})
link_target(a_doc, name, opts \\ %{})
Returns {:ok, url}
if a matching link is found or {:error, %ExHal.Error{...}}
if not.
- a_doc -
ExHal.Document
in which to search for links - name - the rel of the link of interest
opts
:tmpl_vars
-Map
of variables with which to expand any templates found. Default:%{}
:strict
- true if the existence of multiple matching links should cause a failure. Default:false
link_target_lazy(a_doc, name, opts \\ %{}, fun)
link_targets(a_doc, name, opts \\ %{})
Returns {:ok, [url1, ...]}
if a matching link is found or {:error, %ExHal.Error{...}}
if not.
- a_doc -
ExHal.Document
in which to search for links - name - the rel of the link of interest
opts
:tmpl_vars
-Map
of variables with which to expand any templates found. Default:%{}
link_targets_lazy(a_doc, name, opts \\ %{}, fun)
patch(a_doc, name, body, opts \\ %{tmpl_vars: %{}, strict: true})
PATCHs data to the named link in a HAL document.
Returns {:ok, %ExHal.Document{...}, %ExHal.ResponseHeader{...}}
if response is successful and body is HAL;
{:error, %ExHal.Error{...}}
if response is an error if not
post(a_doc, name, body, opts \\ %{tmpl_vars: %{}, strict: true})
Posts data to the named link in a HAL document.
Returns {:ok, %ExHal.Document{...}, %ExHal.ResponseHeader{...}}
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{...}, %ExHal.ResponseHeader{...}}
if response is successful and body is HAL;
{:error, %ExHal.Error{...}}
if response is an error if not