diff options
author | Loïc Hoguin <essen@ninenines.eu> | 2019-10-03 16:20:29 +0200 |
---|---|---|
committer | Loïc Hoguin <essen@ninenines.eu> | 2019-10-03 16:20:29 +0200 |
commit | 28aee1f2720da122f83758b141c503f7bff18ffb (patch) | |
tree | 76dfc7c03cd58726b6e645fff560093bbb0d9e1e /doc/src/manual/cowboy_rest.asciidoc | |
parent | 1ba48c58b1462fb9d9d8c4d9a43878679aea8eb7 (diff) | |
download | cowboy-28aee1f2720da122f83758b141c503f7bff18ffb.tar.gz cowboy-28aee1f2720da122f83758b141c503f7bff18ffb.tar.bz2 cowboy-28aee1f2720da122f83758b141c503f7bff18ffb.zip |
Document media type wildcard in content_types_accepted
Diffstat (limited to 'doc/src/manual/cowboy_rest.asciidoc')
-rw-r--r-- | doc/src/manual/cowboy_rest.asciidoc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/src/manual/cowboy_rest.asciidoc b/doc/src/manual/cowboy_rest.asciidoc index d7901fd..b783a25 100644 --- a/doc/src/manual/cowboy_rest.asciidoc +++ b/doc/src/manual/cowboy_rest.asciidoc @@ -184,7 +184,7 @@ content-type header of the response if the media type is text. ---- content_types_accepted(Req, State) -> {Result, Req, State} -Result :: [{binary() | ParsedMime, AcceptCallback :: atom()}] +Result :: [{'*' | binary() | ParsedMime, AcceptCallback :: atom()}] ParsedMime :: {Type :: binary(), SubType :: binary(), '*' | Params} Params :: [{Key :: binary(), Value :: binary()}] @@ -200,6 +200,8 @@ A media type is made of different parts. The media type `text/html;charset=utf-8` is of type `text`, subtype `html` and has a single parameter `charset` with value `utf-8`. +The special value `'*'` can be used to accept any media type. + // @todo Cowboy needs to ignore the boundary parameter for // multipart, as we never want to match against it. Or allow // ignoring specific parameters at the very least. @@ -724,6 +726,8 @@ listed here, like the authorization header. == Changelog +* *2.7*: The media type wildcard in `content_types_accepted` + is now documented. * *2.6*: The callback `rate_limited` was added. * *2.1*: The `switch_handler` return value was added. * *1.0*: Behavior introduced. |