Php 未设置CURLOPT_HTTPHEADER
使用curl调用带有头的API GET方法 但标题不起作用 响应--连接到52.172.133.9失败:权限被拒绝Php 未设置CURLOPT_HTTPHEADER,php,codeigniter,curl,Php,Codeigniter,Curl,使用curl调用带有头的API GET方法 但标题不起作用 响应--连接到52.172.133.9失败:权限被拒绝 $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_PORT => "25002", CURLOPT_URL => "https://api.eko.in:25002/ekoicici/v1/customers/mobile_number
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_PORT => "25002",
CURLOPT_URL => "https://api.eko.in:25002/ekoicici/v1/customers/mobile_number:8734818474?initiator_id=8734818474",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 60,
CURLOPT_HTTP_VERSION => "CURL_HTTP_VERSION_1_1",
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"developer_key: $developerKey",
"secret-key: $secret_key",
"secret-key-timestamp: $secret_key_timestamp"
)
));
$response = curl_exec($curl);
var_dump($response);
$err = curl_error($curl);
var_dump($err);
var_dump("developerKey--".$developerKey);
var_dump("secret_key--".$secret_key);
var_dump("secret_key_timestamp--".$secret_key_timestamp);
curl_close($curl);
当点击这个URL上的请求时,它需要在头上传递的键,但是头没有设置为curl。
如何解决这一问题…在
$response
中有什么?错误:“连接到52.172.133.9失败:权限被拒绝”。响应:bool(false)