【发布时间】:2021-01-09 03:51:45
【问题描述】:
我正在创建 Web 服务,我想通过 Php 在邮递员中发送“标题”,我该怎么做?如何在 php 中使用邮递员发送和获取标头?我尝试使用以下代码,但我收到响应“请发送访问令牌”,我该如何解决这个问题?提前致谢。 这是我的代码
$tokens=apache_request_headers();
$token=$tokens['access_token'];
if(empty($token))
{
$responseJSON = array("Status" => false,"Message" => "Please enter access token");
header("content-type:application/json");
$response = json_encode($responseJSON);
echo $response;
}
else
{
//your code
}
【问题讨论】: