Skip to content

Commit 651f6c6

Browse files
author
Jon Eyrick
authored
Fixed Signature for this request is not valid by rxcod9
2 parents d731b6b + 87057bd commit 651f6c6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

php-binance-api.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,9 @@ private function httpRequest(string $url, string $method = "GET", array $params
882882
$query = http_build_query($params, '', '&');
883883
$signature = hash_hmac('sha256', $query, $this->api_secret);
884884
if ($method === "POST") {
885-
$endpoint = $base . $url . '?' . 'signature=' . $signature;
885+
$endpoint = $base . $url;
886+
$params['signature'] = $signature; // signature needs to be inside BODY
887+
$query = http_build_query($params, '', '&'); // rebuilding query
886888
} else
887889
$endpoint = $base . $url . '?' . $query . '&signature=' . $signature;
888890
curl_setopt($curl, CURLOPT_URL, $endpoint);

0 commit comments

Comments
 (0)