The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Raisin::Middleware::Formatter - A parser/formatter middleware for Raisin.

VERSION

version 0.92

DESCRIPTION

Parses and formats the data it gets from requests and responses if it's needed.

METHODS

negotiate_format

Negotiates a format from path extension, Accept header or using default format.

A precedence is following:

  • extension; =item * Accept header; =item * default;

In other words if an extension exists the framework doesn't look for Accept header. If the extension is not supported the framework throws an error, the same is for Accept header. Only if both extension and Accept header are not specified it fallback to default format.

format_from_extension

Extracts an extension from a path, and if exists looks for a formatter.

format_from_header

Parses Accept header for known formatters.

AUTHOR

Artur Khabibullin

COPYRIGHT AND LICENSE

This software is copyright (c) 2019 by Artur Khabibullin.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.