We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Awaiting data on a JSON lib in Perl using JSON::XS having unexpected behavior when dealing with boolean true/false.
Related Issue: http://stackoverflow.com/questions/6792173/in-perl-checking-a-json-decoded-boolean-value
Fix: Consider using 1 or 0 for true/false
in bgp_api.cpp line 284
if (entry->atomic_aggregate) { s_s << ",\"atomic_aggregate\":" << "true"; } else { s_s << ",\"atomic_aggregate\":" << "false"; }
CPAN http://search.cpan.org/~mlehmann/JSON-XS-3.01/
use JSON; sub ip_bgp{ # Get IP Address from subroutine call my ( $vars ) = @_; my $ip = $vars->{'ip'}; my $region = $vars->{'region'}; my $return = {}; #Assign API URI vars my $api_uri1 = 'http://noc.' . $region . '.rackspace.net:4567/bgp/ipv4/' . $ip . '/history'; my $api_request1 = LWP::UserAgent->new(); $api_request1->default_header('pragma' => "no-cache", 'max-age' => '0'); $api_request1->timeout(3); my $api_reply1 = $api_request1->get( $api_uri1 ); #Error - API Request if ($api_reply1->is_error){ $return->{'content'} = Dumper $api_reply1; $return->{'code'} = $api_reply1->code(); return $return; } #Success - Gather Reply info if ($api_reply1->is_success){ my $json1 = new JSON; my $json_data1 = $api_reply1->decoded_content; my $data1 = $json1->allow_nonref->utf8->relaxed->escape_slash->loose->allow_singlequote->allow_barekey->decode($json_data1); $return->{'content'} = $data1->{'entries'}[0]; $return->{'code'} = 1; return $return; } }
The text was updated successfully, but these errors were encountered:
MrPeanutButta
No branches or pull requests
Awaiting data on a JSON lib in Perl using JSON::XS having unexpected behavior when dealing with boolean true/false.
Related Issue:
http://stackoverflow.com/questions/6792173/in-perl-checking-a-json-decoded-boolean-value
Fix:
Consider using 1 or 0 for true/false
in bgp_api.cpp line 284
CPAN
http://search.cpan.org/~mlehmann/JSON-XS-3.01/
The text was updated successfully, but these errors were encountered: