The HTTP headers an editor suggests when nothing was recorded: the common request and response header names, each with a line saying what it is, and the values typically written into each.
It is data, with no LiveView in it, so a step editor, a condition editor
or the assistant can all read it. Alternera.Plugin.Editor.HeaderSuggestions
turns it into what a <.suggest_input> reads, with the source exchange's
recorded names put first.
Names are spelled the way documentation spells them (Content-Type);
HTTP compares them ignoring case, and so do values/2 and the editors'
merge with recorded names. The framing headers a proxy or its transport
writes (Content-Length, Transfer-Encoding, Connection, TE,
Upgrade, Keep-Alive) are left out: a step that sets them changes
nothing or breaks the message.
A value may be only the start of one: Bearer ends in a space, so a
pick leaves the cursor where the token goes.
Summary
Types
A header: its name, what it is, and its typical values (possibly none).
Which message a header is written into.
A value typically written into a header, with what it means.
Types
A header: its name, what it is, and its typical values (possibly none).
@type side() :: :request | :response
Which message a header is written into.
A value typically written into a header, with what it means.
Functions
The headers of side, sorted by name ignoring case.
Examples
iex> Alternera.Plugin.HeaderCatalogue.headers(:request) |> Enum.map(& &1.name) |> Enum.take(2)
["Accept", "Accept-Encoding"]
The header names of side, in headers/1's order.
The typical values of the header name in side, matched ignoring case
and surrounding blanks; [] for a header without any or not in the
catalogue.
Examples
iex> Alternera.Plugin.HeaderCatalogue.values(:request, " content-type ") |> hd()
%{value: "application/json", description: "JSON"}