I want to build a client API, and the server documentation says :
DEFINITION
GET https://api.mybitx.com/api/1/balance
EXAMPLE REQUEST
$ curl -u keyid:keysecret https://api.mybitx.com/api/1/balance
here's my code :
<?
require_once('../config.php');
$post = [
'keyid' => $api_key,
'keysecret' => $api_secret
];
$ch = curl_init('https://api.mybitx.com/api/1/balance');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
?>
it gives me :
string(19) "Method Not Allowed "
but when I run :
$ curl -u *****:***** https://api.mybitx.com/api/1/balance
from SSH terminal, it gives me correct result. what's wrong with my PHP Curl code?
thank you