$VERSION = eval $VERSION;
use strict;
use Carp;
use Data::Dumper qw/Dumper/;
use JSON qw/decode_json/;
use File::Spec qw//;
use Digest::MD5 qw/md5_hex/;
use POSIX qw/str
est->new(
user_agent => $self->{user_agent},
# path is sprintf'd before call, in api_json_request
# the calling function passes in path %s's in 'args' param
url => sp
# Why is this static?
my $message = Reddit::Client::Request->token_request(%p);
my $j = decode_json($message);
$self->{token} = $j->{access_token};
$self->{tokentype} = $j->{token_type};
if
olean value of 1 or 0, rather than the JSON
module's boolean type.
=item load_from_source_data($data)
Populates an instances field with data directly from JSON data returned
by reddit's servers.
=b
package Reddit::Client::Request;
use strict;
use warnings;
use Carp;
use JSON qw/encode_json decode_json/;
use LWP::UserAgent qw//;
use HTTP::Request qw//;
use URI::Encode qw/uri_encod
;
} elsif ($self->{request_errors}) {
my $json;
my $success = eval { $json = decode_json $res->{_content}; };
# If Reddit returned valid json, add it to a hash and print it
if ($succes
code => $res->code,
status_line => $res->status_line,
data => $json,
};
my $rtn = encode_json $err;
die "$rtn\n";
} else {
die "Request error: HTTP ".$res->sta