Instream v0.20.0 Instream.Query.Headers View Source
Header Utility.
Link to this section Summary
Functions
Assembles the headers for a query.
Assembles headers for basic authentication.
Assembles headers for response encoding.
Assembles headers required for query language selection.
Link to this section Functions
Link to this function
assemble(config, options \\ []) View Source
Assembles the headers for a query.
Link to this function
assemble_auth(auth) View Source
Assembles headers for basic authentication.
Will return an empty list if query authentication is configured. Will return an empty list if either username of password is missing.
Usage
iex> assemble_auth([ method: :query ])
[]
iex> assemble_auth([ username: "user" ])
[]
iex> assemble_auth([ password: "pass" ])
[]
iex> assemble_auth([ username: "user", password: "pass" ])
[{"Authorization", "Basic dXNlcjpwYXNz"}]
Link to this function
assemble_encoding(atom) View Source
Assembles headers for response encoding.
Usage
iex> assemble_encoding(nil)
[]
# not handled here...
iex> assemble_encoding(:raw)
[]
iex> assemble_encoding(:csv)
[{"Accept", "application/csv"}]
iex> assemble_encoding(:json)
[{"Accept", "application/json"}]
Link to this function
assemble_language(atom) View Source
Assembles headers required for query language selection.
Usage
iex> assemble_language(nil)
[]
iex> assemble_language(:flux)
[{"Accept", "application/csv"}, {"Content-Type", "application/vnd.flux"}]