package JSON::API;
use strict;
use HTTP::Status qw/:constants/;
use LWP::UserAgent;
use JSON;
use Data::Dumper;
use URI::Encode qw/uri_encode/;
BEGIN {
use Exporter ();
use vars qw($VERSION @ISA @E
ication/json',
'Content-Type' => 'application/json',
);
if( $apphdr && ref $apphdr ) {
$headers->header( $_, $apphdr->{$_} ) foreach (keys %$apphdr);
}
my $json;
if (
defined $data) {
$json = $self->_encode($data);
return (wantarray ? (500, {}) : {}) unless defined $json;
}
my $req = HTTP::Request->new($method, $url, $headers, $json);
$self->_debug("Request