View Source accept_encoding_header (accept v0.3.6)

For parsing and negotiating Accept-Encoding headers.

Summary

Types

Accept options.

Content codings.

Media ranges.

Functions

Negotiates the most appropriate content_coding given the accept header

Parses Accept-Encoding header, returns a list of content_codings.

Types

accept_option()

-type accept_option() :: #accept_option{option :: string(), q :: number(), params :: [string()]}.

Accept options.

content_coding()

-type content_coding() :: #content_coding{coding :: string(), q :: number(), params :: [string()]}.

Content codings.

media_range()

-type media_range() ::
          #media_range{type :: string(), subtype :: string(), q :: number(), params :: [string()]}.

Media ranges.

Functions

negotiate(Header, Alternatives)

-spec negotiate(Header, Alternatives) -> Match
                   when
                       Header :: undefined | binary() | string(),
                       Alternatives :: [Alternative],
                       Alternative :: binary() | {binary(), Tag},
                       Tag :: any(),
                       Match :: Tag | nomatch.

Negotiates the most appropriate content_coding given the accept header

parse(AcceptString)

-spec parse(AcceptString) -> Result
               when AcceptString :: binary() | string(), Result :: [content_coding()].

Parses Accept-Encoding header, returns a list of content_codings.