• <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 获取请求头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Zend_Controller_Router_Exception: quot;xyzquot; is not specified(Zend_Controller_Router_Exception:“xyz;未指定)
                  Zend_Db_Table subquery(Zend_Db_Table 子查询)
                  pcntl_fork and the MySQL connection is gone(pcntl_fork 和 MySQL 连接消失了)
                  Change layout in the controller of Zend Framework 2.0(在 Zend Framework 2.0 的控制器中更改布局)
                  Zend Mail Gmail SMTP(Zend 邮件 Gmail SMTP)
                  Zend_Form: how to check 2 fields are identical(Zend_Form:如何检查 2 个字段是否相同)

                    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>