如何在Laravel 5.0中获得授权标头

时间:2019-06-12 02:43:09

标签: php laravel

我无法在laravel请求中获得承载令牌

但是我尝试使用apache_request_headers()可以获取令牌。我想用laravel方法来做,所以能帮我吗?

当我这样打印时...

dd(apache_request_headers(), $request->header('Authorization'));

显示...

array:11 [
  "Authorization" => "Bearer eyJxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  "User-Agent" => "PostmanRuntime/7.13.0"
  "Accept" => "*/*"
  "Cache-Control" => "no-cache"
  "Postman-Token" => "xxxxx"
  "Host" => "localhost"
  "cookie" => "laravel_session=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  "accept-encoding" => "gzip, deflate"
  "content-length" => "0"
  "Connection" => "keep-alive"
  "X-Prerender-Token" => "xxxxxxxxxxxxxxxxxxxxxxx"
]
null

0 个答案:

没有答案