am trying to parse blockchain wallet service api, but am getting this error

malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "Can't connect to 127...") at test.pl line 18.

Thanks Appreciate for help

Blockchain Wallet Service API Create Wallet API Create blockchain wallets programmatically The create_wallet method can be used to create a new blockchain.info b +itcoin wallet. URL: http://localhost:3000/api/v2/create Method: POST or GET $password - The password for the new wallet. Must be at least 10 chara +cters in length. $api_code - An API code with create wallets permission. $priv - A private key to add to the wallet (Wallet import format prefe +rred). (Optional) $label - A label to set for the first address in the wallet. Alphanume +ric only. (Optional) $email - An email to associate with the new wallet i.e. the email addr +ess of the user you are creating this wallet on behalf of. (Optional) Please create an API code here including permissions to "Create Wallet +s". Response: 200 OK, application/json { "guid": "4b8cd8e9-9480-44cc-b7f2-527e98ee3287", "address": "12AaMuRnzw6vW6s2KPRAGeX53meTf8JbZS", "label": "Main address" }
#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; use JSON::XS; my $password = "wa111110993"; my $api_code = "asdsadas"; my $url = 'http://127.0.0.1:3000/api/v2/create'; my $ua = LWP::UserAgent->new(); my $response = $ua->post( $url, { 'password' => $password, 'api_code' + => $api_code,}); my $Rep = JSON::XS->new->decode ($response->content); my $Guid = $Rep->{guid}; my $Address = $Rep->{address}; print "Guid is: $Guid\n"; print "Address is: $Address\n";

In reply to Blockchain error by frank1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.