bigup401 has asked for the wisdom of the Perl Monks concerning the following question:
API curl -H "Content-Type: text/plain" --data '{"key":"[your-key-here]","a +ddr":"183qrMGHzMstARRh2rVoRepAd919sGgMHb","callback":"https://mystore +.com?invoice_id=123","onNotification":"KEEP", "op":"RECEIVE", "confs" +: 5}' https://api.blockchain.info/v2/receive/balance_update
I GET 400 Bad Request
#!/usr/bin/perl -w use LWP::UserAgent; use JSON; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); my $ua = LWP::UserAgent->new; my $url = "https://api.blockchain.info/v2/receive/balance_update"; my $json = encode_json { key => 'fdsrr34324234', addr => '183qrMGHzMstARRh2rVoRepAd919sGgMHb', callback => 'https://mystore.com', onNotification => 'DELETE', op => 'RECEIVE', confs => '0', }; my $req = HTTP::Request->new(POST => $url); $req->content_type('text/plain'); $req->content($json); my $response = $ua->request($req); print "Content-type: text/html\n\n"; if ($response->is_success) { print $response->content; } else { print $response->status_line; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 400 bad request curl post
by Corion (Patriarch) on Dec 06, 2018 at 08:08 UTC | |
by bigup401 (Pilgrim) on Dec 06, 2018 at 11:39 UTC | |
by bigup401 (Pilgrim) on Dec 06, 2018 at 11:50 UTC | |
by Corion (Patriarch) on Dec 06, 2018 at 11:52 UTC | |
|
Re: 400 bad request curl post
by hippo (Archbishop) on Dec 05, 2018 at 23:42 UTC | |
|
Re: 400 bad request curl post
by 1nickt (Canon) on Dec 06, 2018 at 00:33 UTC | |
by bigup401 (Pilgrim) on Dec 06, 2018 at 11:28 UTC | |
by 1nickt (Canon) on Dec 06, 2018 at 13:16 UTC | |
by kschwab (Vicar) on Dec 06, 2018 at 15:37 UTC | |
by 1nickt (Canon) on Dec 06, 2018 at 16:34 UTC | |
| |
|
Re: 400 bad request curl post
by stevieb (Canon) on Dec 05, 2018 at 21:52 UTC | |
by bigup401 (Pilgrim) on Dec 05, 2018 at 21:56 UTC | |
by stevieb (Canon) on Dec 05, 2018 at 22:25 UTC | |
|
Re: 400 bad request curl post
by talexb (Chancellor) on Dec 09, 2018 at 14:10 UTC |