这是curl_getinfo($ process)的输出;为什么插入\字符。当我提出请求时,我收到有关该URL不存在的错误。嗯,这些字符不存在...而且它不是有效的网址。
https:\/\/test-test.xxx.com\/wapi\/v2.6.1\/network
为什么不只是
https://test-test.xxx.com/wapi/v2.6.1/network
这是其余的代码:
$process = curl_init($host);
curl_setopt($process, CURLOPT_HTTPHEADER, $request_headers);
curl_setopt($process, CURLOPT_HEADER, FALSE);
curl_setopt($process, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($process, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($process, CURLOPT_TIMEOUT, 30);
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($process);
error_log( json_encode( curl_getinfo($process) ) );