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.ユーザの承認を確認するには、<a href="">
1
A
答えて
1
This cannot be accomplished with HTML, JavaScript or JQuery.
HTTP headers are sent long before HTML is parsed or rendered, let alone running scripts.
You can send authorisation headers from the server configuration (.htaccess, etc.) or from a script running at the server, like PHP.
関連する問題
- 1. タグ内<a href="....."></a></td> DOUBLE_WHITESPCE in query href
- 2. 承認アクションフィルタと承認フィルタの違いは何ですか? <a href="http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/understanding-action-filters-cs" rel="noreferrer">ASP.NET website</a></p> <p>ASP.NET MVCフレームワーク1として
- 3. onclickハンドラーを<a>タグでクリックしたタグを確認
- 4. href式<a href="javascript:;"></a>の機能は何ですか?
- 5. 空のリクエストBodyを確認する最も良い方法は何ですか? <a href="https://golang.org/src/net/http/request.go" rel="noreferrer">documentation</a>から
- 6. 埋め込みソースをラップする<a href=""></a>
- 7. ACME:<domain>の承認エラー(ACME/autocert)
- 8. RabbitMQ - HTTP認証バックエンドは認証にのみ使用しますか? <a href="https://www.rabbitmq.com/access-control.html" rel="nofollow">https://www.rabbitmq.com/access-control.html</a>パー
- 9. jQuery - target.href <a href="#"><img></a>
- 10. hrefに代わるもの、<a>
- 11. を渡す値は<a href= > tag
- 12. ダイナミックHREFタグは、しかし、私はJSX</p> <pre><code><a href="mailto: {this.props.email}">{this.props.email}</a> // => <a href="mailto: {this.props.email}"></a> </code></pre> <p>でHREFタグを、それを再作成するのに苦労していますJSX
- 13. リストのモードを確認するには<double>?
- 14. 今日の日付を確認するには<javascript>
- 15. アンカー(<a href="URL">URL</a>)(<p>URL</p>)
- 16. <a href>とfont awesome
- 17. <a href="url_of_data"> click
- 18. シミュレート "<a href>" in Angular
- 19. <a href> link with id
- 20. ロールオーバーテキストなし<a href>
- 21. アンカータグ<a href = "#"> using scrapy
- 22. z-インデックスと<a href>
- 23. html/javascript:<a href>
- 24. <a href..> html tag
- 25. <a href> tags in Python
- 26. <A href> adding " to URL
- 27. hrefアンカーテキスト後</a>
- 28. <a href="#" onclick="funtion('test.php')">
- 29. は、Java用<a href="http://www.magnolia-cms.com/" rel="nofollow">MAGNOLIA</a></p> <p>CMSを使用する
- 30. PHPの警告:filemtime()[<a href='function.filemtime'>function.filemtime</a>]
Why? What's the use-case for this? –
Welcome to SO! Please read ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and show what you've tried so we can help. – Darren
Actually, I'm using Laravel passport for authorization. And I've to check where the user is authorized with laravel passport to achieve some functionality. Laravel Passport will check for 'Authorization' => 'Bearer '.$accessToken header to authorize the user. So, I have to add authorization header in each client made through the click of のクリック時にクライアントブラウザのリクエストに認証ヘッダーを追加します。 –