JSON RPC message "Invalid payload"

I am trying to make some calls to my bitcoin wallet using the API provided at ( https://blockchain.info/api/json_rpc_api )

I am using PHP wrapper files from the site linked above.

I am trying to call the can_connect method to make sure all my parameters are correct, the bit is returned as

Invalid Return Payload: Enable Debug to Check Incoming Payload Invalid Data

Looking at the files I can see that there are both xmlrpc and jsonrpc. I'm curious if it's called wrong?

My code:

include "AuctionFunctions.inc.php";

$btc = getConnection();
$canConnect = $btc->can_connect();
//echo $canConnect;

//if ($canConnect) {
//  $status = setup();
//  echo $status;


this method must return a boolean value. Instead, this is what it returns (I turned on debug mode like initial error)

Note. I tried the advice https://github.com/mikegogulski/bitcoin-php/issues/7 However, this did not fix the issue.

--- GOT --- HTTP / 1.1 200 OK Date: Thu, 11 Sep 2014 05:32:45 GMT Server: Apache Last updated: Wed, 19 Sep 2012 21:23:04 GMT Accept-Ranges: Bytes. Vary: Accept-Encoding: gzip Content-Length: 92 Connection: close Content-Type: text / html

<³QÔÕU (HLOÍÏVÐÕμã²ñsó €)) i • ¥ ©% º ùÅ% ™ yéÉÅÅ •% ¹9 @ ª (OB €> Ie £ "ª-> L [--- END ---

HEADER: Date: Thu 11 Sep 2014 05:32:45 GMT HEADER: Server: Apache HEADER: Last Modified: Wed 19 Sep 2012 21:23:04 GMT HEADER: accept-range: bytes HEADER: different: Accept-Encoding HEADER: content-encoding: gzip HEADER: content length: 92 HEADER: connection: close HEADER: content-type: text / html

--- STRONG ANSWER --- [91 characters] ---


--- END ---

Invalid Return Payload: Enable Debugging to Check Incoming Payload Invalid Data

the getConnection () method is located in the AuctionFunctions.inc.php file, which is included in the file that calls it. AuctionFunctions contains a method as shown:

function getConnection() {
$scheme = 'http';
$username = 'username here';
$password = 'password here';
$addresss = 'rpc.blockchain.info';
$port = '80';
$certificate_path = '';
$debug_level = 2;   
$btc = new BitcoinClient($scheme, $username, $password, $address = "localhost", $port = 80, $certificate_path, $debug_level);

return $btc; //returns BitcoinClient object



the BitcoinClient class is stored in the bitcoin.inc file and can be downloaded here: https://github.com/mikegogulski/bitcoin-php


source to share

All Articles