Skip to content

Commit

Permalink
Use encode_json instead of to_json:
Browse files Browse the repository at this point in the history
to_json is not provided by JSON::MaybeXS. We use encode_json instead.

This fixes a breakage that was presented by the rev_deps.pl example.
  • Loading branch information
xsawyerx committed Apr 27, 2014
1 parent 9643f54 commit 61876c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/MetaCPAN/Client/Request.pm
Expand Up @@ -5,7 +5,7 @@ package MetaCPAN::Client::Request;

use Moo;
use Carp;
use JSON::MaybeXS 'decode_json';
use JSON::MaybeXS qw<decode_json encode_json>;
use Search::Elasticsearch;
use Search::Elasticsearch::Scroll;
use Try::Tiny;
Expand Down Expand Up @@ -56,7 +56,7 @@ sub fetch {
my $ua = $self->ua;

my $result = keys %{$params}
? $ua->post( $req_url, { content => to_json $params } )
? $ua->post( $req_url, { content => encode_json $params } )
: $ua->get($req_url);

return $self->_decode_result( $result, $req_url );
Expand Down

0 comments on commit 61876c8

Please sign in to comment.