Group
Extension

Matches 1

Plack-Middleware-SetAccept ( R/RH/RHOELZ/Plack-Middleware-SetAccept-0.01.tar.gz, RHOELZ, 2011; MetaCPAN )
Plack-Middleware-SetAccept/lib/Plack/Middleware/SetAccept.pm ( view source; MetaCPAN )
my %map = (
    json => 'application/json',
    xml  => 'application/xml',
  );

  builder {
    enable 'SetAccept', from => 'suffix', mapping => \%map;
    $app;
  };
  # now /foo.json behaves as /fo
o, with Accept: application/json

  # or

  builder {
    enable 'SetAccept', from => 'param', param => 'format', mapping => \%map;
    $app;
  };
  # now /foo?format=xml behaves as /foo, with Accept:
request
URI.  It can extract from either the suffix of the path (ex. /foo.json) or
from the query string (ex. /foo?format=json) for HEAD and GET requests.  The
value is looked up in a mapping table an

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.