简体   繁体   English

Laravel 5.2 - 与webservices有关的问题

[英]Laravel 5.2 - issue with webservices

Recently I am facing one issue with laravel 5.2 Actually, my project is setup on shared hosting server, I am using larval 5.2 for web services but I can't able to pass token with a header, the same code is working fine with 4.2 And the same code is working fine on any dedicated server, From my first R&D I found that I can't able to pass information in the header if my SERVER ["HTTP_CONNECTION"] is 'Off' once I change it to KeepAlive On everything is working good. 最近我面临laravel 5.2的一个问题实际上,我的项目是在共享托管服务器上设置的,我使用larval 5.2进行Web服务但是我无法通过标头传递令牌,相同的代码可以正常使用4.2和相同的代码在任何专用服务器上工作正常,从我的第一次研发中发现,如果我的SERVER [“HTTP_CONNECTION”]为'Off',我将无法在标题中传递信息,一旦我将其更改为KeepAlive,一切都是工作得很好。 Can anyone help me on this. 谁可以帮我这个事。 ?

Finally i found solution of my problem :) Just use below code in your htaccess file 最后我找到了我的问题的解决方案:)只需在你的htaccess文件中使用下面的代码

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

It's Done 完成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM