View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Brian Duggan > Clustericious-0.9910 > Clustericious::Plugin::AutodataHandler



Annotate this POD

View/Report Bugs
Source   Latest Release: Clustericious-1.29


Clustericious::Plugin::DataHandler -- Handle data types automatically



Adds a renderer that automatically serializes that "autodata" in the stash into a format based on HTTP Accept and Content-Type headers. Also adds a helper called 'parse_autodata' that handles incoming data by Content-Type.

Supports application/json, text/x-yaml and application/x-www-form-urlencoded (in-bound only).

When parse_autodata is called from within a route like this:


POSTed data is parsed according to the type in the 'Content-Type' header with the data left in stash->{autodata}. It is also returned by the above call.

If a route leaves data in stash->{autodata}, it is rendered by this handler, which chooses the type with the first acceptable type listed in the Accept header, the Content-Type header, or the default. (By default, the default is application/json, but you can override that too).


more documentation

handle XML with schemas

handle RDF with templates

Should I make this a 'helper' instead of a 'hook'? Or just a normal function?

syntax highlighting: