0
오류없이 메소드 프로그램의 매개 변수로 "info"
만 설정하면 객체 호출 API가 생성되었습니다. 그런 매개 변수를 설정할 때 ("swapList", $ t) 나는 {"error":407,"errorMsg":"Invalid value: currency","time":1476023664,"limit":{"used":5,"allowed":600,"expires":1476024000}}
을 얻습니다. 많은 배열을 시도했지만 결과는 같았습니다. 다음은 API 문서 https://github.com/bitmarket-net/api잘못된 API 매개 변수
것은 여기에 당신은 키 이름없이 매개 변수 배열을 전달 내 코드
<html>
<body>
<?php
class API
{
public function bitmarket_api($method, $params = array())
{
$key = "XXXXXXXXXXXXXXXXXXXXX";
$secret = "XXXXXXXXXXXXXXXXXXXX";
$params["method"] = $method;
$params["tonce"] = time();
$post = http_build_query($params, "", "&");
$sign = hash_hmac("sha512", $post, $secret);
$headers = array(
"API-Key: " . $key,
"API-Hash: ". $sign,
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, "https://www.bitmarket.pl/api2/");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$ret = curl_exec($curl);
if ($ret === false)
{
die(curl_error($curl));
}
echo $ret;
}
}
$t[]='BTC';
$z =new API;
$z->bitmarket_api('swapList',$t);
?>
</body>
</html>
도와 작품 : – Jane
행복, 그리고 스택 오버플로에 오신 것을 환영합니다. 이 답변으로 문제가 해결되면 수락으로 표시하십시오. – devneri