View Source HTTPSpec.Request.Query (http_spec v2.1.0)

Helpers to handle key-value pairs in query.

Because query doesn't always contain key-value pairs, so related helpers are grouped as this extra module.

Summary

Types

@type encoding() :: :www_form | :rfc3986
@type name() :: any()
@type t() :: %HTTPSpec.Request.Query{internal: map()}
@type value() :: any()

Functions

Link to this function

decode(query, encoding \\ :www_form)

View Source
@spec decode(HTTPSpec.Request.query(), encoding()) :: t()
@spec delete(t(), name()) :: t()
Link to this function

encode(struct, encoding \\ :www_form)

View Source
@spec encode(t(), encoding()) :: HTTPSpec.Request.query()
Link to this function

get(struct, name, default \\ nil)

View Source
@spec get(t(), name(), value()) :: t()
@spec new(map()) :: t()
Link to this function

put(struct, name, value)

View Source
@spec put(t(), name(), value()) :: t()
Link to this function

put_new(struct, name, value)

View Source
@spec put_new(t(), name(), value()) :: t()
Link to this function

put_new_lazy(struct, name, fun)

View Source
@spec put_new_lazy(t(), name(), (-> value())) :: t()