• <legend id='Getkv'><style id='Getkv'><dir id='Getkv'><q id='Getkv'></q></dir></style></legend>
      <bdo id='Getkv'></bdo><ul id='Getkv'></ul>

      <i id='Getkv'><tr id='Getkv'><dt id='Getkv'><q id='Getkv'><span id='Getkv'><b id='Getkv'><form id='Getkv'><ins id='Getkv'></ins><ul id='Getkv'></ul><sub id='Getkv'></sub></form><legend id='Getkv'></legend><bdo id='Getkv'><pre id='Getkv'><center id='Getkv'></center></pre></bdo></b><th id='Getkv'></th></span></q></dt></tr></i><div id='Getkv'><tfoot id='Getkv'></tfoot><dl id='Getkv'><fieldset id='Getkv'></fieldset></dl></div>

    1. <small id='Getkv'></small><noframes id='Getkv'>

      <tfoot id='Getkv'></tfoot>

        Laravel 获取请求头

        Laravel get request headers(Laravel 获取请求头)

        <tfoot id='yiIcp'></tfoot>
                <tbody id='yiIcp'></tbody>

            1. <i id='yiIcp'><tr id='yiIcp'><dt id='yiIcp'><q id='yiIcp'><span id='yiIcp'><b id='yiIcp'><form id='yiIcp'><ins id='yiIcp'></ins><ul id='yiIcp'></ul><sub id='yiIcp'></sub></form><legend id='yiIcp'></legend><bdo id='yiIcp'><pre id='yiIcp'><center id='yiIcp'></center></pre></bdo></b><th id='yiIcp'></th></span></q></dt></tr></i><div id='yiIcp'><tfoot id='yiIcp'></tfoot><dl id='yiIcp'><fieldset id='yiIcp'></fieldset></dl></div>
              <legend id='yiIcp'><style id='yiIcp'><dir id='yiIcp'><q id='yiIcp'></q></dir></style></legend>

                <small id='yiIcp'></small><noframes id='yiIcp'>

                  <bdo id='yiIcp'></bdo><ul id='yiIcp'></ul>
                  本文介绍了Laravel 获取请求头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 POSTMAN 将 GET 请求发送到带有包含授权的标头的 api 中.

                  I am using POSTMAN to send a GET request into the api with a header containing Authorization.

                  我知道数据头有效,因为如果无效,路由会返回 401 错误.

                  I know the data header works because if it doesn't the route returns a 401 error.

                  我想像这样获得授权标头:

                  I wanted to get the Authorization header like so:

                  $access_token = Request::header('Authorization');
                  

                  但注意到它返回NULL.

                  But noticed that it returns NULL.

                  所以我试图用以下方法捕捉值:

                  So I tried to catch the values with:

                  die(var_dump(Request::header()));
                  

                  并注意到它不包含任何授权标头.只需托管到 cookie 标头.

                  And noticed that it doesn't contain any Authorization header. Just host to cookie headers.

                  更新

                  应该得到Authorization: Bearer ACCESS TOKEN

                  推荐答案

                  你用的是什么 POSTMAN 版本?

                  What POSTMAN Version did you use?

                  您是在本地计算机还是托管服务器上,某些托管公司不允许使用 AUTHORIZATION HEADER.

                  Are you on your local machine or managed server, some hosting companies don't allow AUTHORIZATION HEADER.

                  .htaccess 修改

                   RewriteEngine On
                   RewriteCond %{HTTP:Authorization} .
                   RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
                  

                  这篇关于Laravel 获取请求头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    1. <small id='zlyY2'></small><noframes id='zlyY2'>

                      <tfoot id='zlyY2'></tfoot>

                          <tbody id='zlyY2'></tbody>
                        <i id='zlyY2'><tr id='zlyY2'><dt id='zlyY2'><q id='zlyY2'><span id='zlyY2'><b id='zlyY2'><form id='zlyY2'><ins id='zlyY2'></ins><ul id='zlyY2'></ul><sub id='zlyY2'></sub></form><legend id='zlyY2'></legend><bdo id='zlyY2'><pre id='zlyY2'><center id='zlyY2'></center></pre></bdo></b><th id='zlyY2'></th></span></q></dt></tr></i><div id='zlyY2'><tfoot id='zlyY2'></tfoot><dl id='zlyY2'><fieldset id='zlyY2'></fieldset></dl></div>

                            <bdo id='zlyY2'></bdo><ul id='zlyY2'></ul>
                          • <legend id='zlyY2'><style id='zlyY2'><dir id='zlyY2'><q id='zlyY2'></q></dir></style></legend>