View Source Tesla.Middleware.DecodeRels (tesla v1.13.2)

Decode Link Hypermedia HTTP header into opts[:rels] field in response.

Examples

defmodule MyClient do
  def client do
    Tesla.client([Tesla.Middleware.DecodeRels])
  end
end

client = MyClient.client()

env = Tesla.get(client, "/...")

env.opts[:rels]
# => %{"Next" => "http://...", "Prev" => "..."}