Skip to content

Response No JSON object could be decoded #14

@javierdelgado1

Description

@javierdelgado1

Hello guys, I am trying to make a request, but I have not had any success, I always send my fix in Json format but I always get the same answer, how can I solve this?

The small code is written in php using the laravel framework 5.4.3

    $nonce = strval(time());
    $signature = hash_hmac("sha256", $nonce, $this->secret); 
    $array = [
        "MsgType" => "U2",
        "BalanceReqID" => 1,
    ];
    $message = json_encode($array);
    $client = new \GuzzleHttp\Client(array( "curl" => array(CURLOPT_SSL_VERIFYPEER => false)));
    $response = $client->request(
                "POST", "https://api.testnet.blinktrade.com/tapi/v1/message", [
                    'headers' => [
                        "User-Agent" => "testing/1.0",
                        "Content-Type"     => "application/json",
                        "Nonce"      => $nonce,
                        "Signature" => $signature,
                        "APIKey" => $this->key
                    ]
                ],  $message

    );
    $response = json_decode($response->getBody()->getContents());
    return  response()->json($response);   

Thank you very much for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions