我在页面上有以下内容:
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.royalmail.net/***/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"x-ibm-client-id: ***",
"x-ibm-client-secret: ***"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
我拥有从Royal Mail端获得的所有授权,并且在Royal Mail沙箱中运行时,它可以提供所需的结果,但是从服务器上的页面运行时,它会返回:
{“ httpCode”:“ 404”,“ httpMessage”:“未找到”,“ moreInformation”:“没有资源匹配请求的URI”}
任何人都可以向我指出可能导致此问题的正确方向。