View Source HTTPSpec.Request.QueryParams (http_spec v3.0.0)

Helpers for handling key-value pairs which are encoded as query.

Note

This module doesn't support Key-value pairs that contains duplicate keys, because the underlying data structure is a map.

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

Summary

Types

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

Functions

Link to this function

decode(query, encoding \\ :rfc3986)

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

encode(struct, encoding \\ :rfc3986)

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()