单击<a href="">

时间:2017-06-08 16:03:51

标签: javascript html laravel http http-headers

I would like to add 'authorization' header in each client request made with browser on click of Some Link. And these requests are not ajax based.
For example,
When I access 'domain/sample' directly through URL bar, the 'authorization' header should not set. But when I'm click , the 'authorization' header should set with some value. And I would like to do it with basic HTML, Javascript, and Jquery.

1 个答案:

答案 0 :(得分:1)

使用HTML,JavaScript或JQuery无法实现这一目标。

在解析或呈现HTML之前很久就会发送HTTP标头,更不用说运行脚本了。

您可以从服务器配置(.htaccess等)或从服务器上运行的脚本(如PHP)发送授权标头。