From: John Napiorkowski Date: Fri, 20 Sep 2013 18:10:20 +0000 (-0400) Subject: actually document the new request body_data method X-Git-Tag: 5.90050~1^2~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=974733c0febbddd53145ec82031b4ad6abcc0985 actually document the new request body_data method --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 56dc5a2..8fc94d6 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -3160,6 +3160,9 @@ installed it. If you don't mind the XS dependency, you should add the faster L to you dependency list (in your Makefile.PL or dist.ini, or cpanfile, etc.) +L is loaded the first time you ask for it (so if you never ask +for it, its never used). + =cut sub registered_data_handlers { diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 329254b..ab87e17 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -351,6 +351,7 @@ Catalyst::Request - provides information about the current client request $req->args; $req->base; $req->body; + $req->body_data; $req->body_parameters; $req->content_encoding; $req->content_length; @@ -433,6 +434,14 @@ Returns the message body of the request, as returned by L: a string, unless Content-Type is C, C, or C, in which case a L object is returned. +=head2 $req->body_data + +Returns a Perl representation of POST/PUT body data that is not classic HTML +form data, such as JSON, XML, etc. By default, Catalyst will parse incoming +data of the type 'application/json' and return access to that data via this +method. You may define addition data_handlers via a global configuration +setting. See L for more information. + =head2 $req->body_parameters Returns a reference to a hash containing body (POST) parameters. Values can