when docking with API, no content-type, data is returned in the API response header of the other party, but how to get it in PHP?
with API link:
https://api.huobipro.com/mark.
with PHP code:
<?php
$url = "https://api.huobipro.com/market/history/kline?AccessKeyId=5425863f-264c3daa-08865b14-81be8&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2018-06-02T02%3A42%3A55&period=1min&size=150&symbol=btcusdt&Signature=WezIbDKAemjOnyIraKbHYZRl49SkthvhW%2F9Sq%2Bs4LPQ%3D";
$res = curl($url);
function curl($url) {
var_dump($url);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_TIMEOUT,60);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt ($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
]);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
var_dump($info);
curl_close($ch);
var_dump($output); // false
return $output;
}
but when browser access is open normally, which setting is required?