HTTP::Response::JSON - a subclass of HTTP::Response that understands JSON
if ($response->isa('HTTP::Response::JSON')) { Your::Own::Code::do_something($response->json_content); }
This is a simple subclass of HTTP::Response that implements a method "json_content" which returns the JSON-decoded contents of the response.
Out: $perl_data
Returns the Perl data structure corresponding to the contents of this response.
Will throw an exception if the contents look like JSON but cannot be converted to JSON. Will return undef if the contents don't look like JSON.
Sam Kington <skington@cpan.org>
The source code for this module is hosted on GitHub https://github.com/skington/lwp-json-tiny - this is probably the best place to look for suggestions and feedback.
Copyright (c) 2015 Sam Kington.
This library is free software and may be distributed under the same terms as perl itself.
To install LWP::JSON::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LWP::JSON::Tiny
CPAN shell
perl -MCPAN -e shell install LWP::JSON::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.