我正在尝试实现 TNT 标签 API,它想在请求中发送访问令牌。
我将访问令牌代码作为 POST 字段发送,但它不起作用。
有任何想法吗?
谢谢
我将访问令牌作为帖子字段发送,但它不起作用并返回错误 "{ "error": "invalid_request", "description": "所需的参数访问令牌丢失。" }"
function httpPostRequest($url, $strRequest,$auth)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $strRequest);
curl_setopt($ch, CURLOPT_POSTFIELDS, $access_token);
$isSecure = strpos($url, "https://");
if ($isSecure === 0) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
}
$result = curl_exec($ch);
$this->errorCode = curl_errno($ch);
$this->errorMessage = curl_error($ch);
return $result;
}
预期:应返回成功消息实际: { "error": "invalid_request", "description": "The required parameter access token is missing." }
阿晨1998
蛊毒传说