Instream v0.9.0 Instream.Query.Headers

Header Utility.

Summary

Functions

Assembles the headers for a query

Assembles headers for basic authentication

Functions

assemble(conn)

Specs

assemble(Keyword.t) :: list

Assembles the headers for a query.

assemble_auth(auth)

Specs

assemble_auth(Keyword.t) :: list

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'}]