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.Berechtigungsheader in der Client-Browser-Anfrage hinzufügen, wenn Sie auf <a href="">
1
A
Antwort
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.
Verwandte Themen
- 1. # in URL ausblenden, wenn Sie auf <a href="#">
- 2. <a href onClick> wenn Funktion
- 3. konvertieren schlecht <span href = „#“><a href="#">
- 4. Hinzufügen von URL in <a href=""> with Emmet
- 5. <a href="www.example.com">example</a> verweist auf mysite.com/www.example.com?
- 6. Verständnis "javascript: ...;" innerhalb <a href=" ">
- 7. Optimiertes Scrollen mit <a href='#'>
- 8. Verhindern Bildschirm bewegt sich beim Klicken auf <a href=></a>
- 9. Was bedeutet <a href="#!"> do?
- 10. button_to zu <a href ="">
- 11. Wie <a href> tag?
- 12. PHP Regex. Konvertieren Sie [Text] (url) zu <a href="url">text</a>
- 13. Html- wie <a href>?
- 14. Passing Javascript Variable <a href >
- 15. Anchors (<a href="URL">URL</a>) anstelle von Text (<p>URL</p>)
- 16. H4 Tag auf <a href> Link
- 17. Wrapping einer eingebetteten Quelle mit <a href=""></a>
- 18. Link öffnet nicht in neuen Tab mit <a href ></a>
- 19. Python brauchen dritten Zitat Stil für '<a href="{{ url_for('index') }}"> index</a>'
- 20. Wie gesetzt href in html <a> tag
- 21. Fehler beim Abrufen der <a href = ' '> value
- 22. So übergeben Sie den href-Wert in <a></a> Tag dynamisch unter Listview
- 23. Wie ziehe ich href aus <a> in Python
- 24. Wie man eine Übermittlung von einer <a href...>...</a> Verbindung herstellt?
- 25. document.write (Variable) in href Attribut <a> Tag
- 26. Wie kann ich <a href='$game_link' target='_blank'>$game_link</a> eine Schaltfläche
- 27. Angular JS "<a href='tel:{num} '> call me</a> Hyperlink funktioniert nicht
- 28. Was bedeutet loc = $ ('<a>', {href: window.location}) [0]; bedeuten?
- 29. dynamisch <a href> ereignis ohne ersatz
- 30. Abrufen aller <a href=....jpg"> tags in PHP
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 klicken, um zu prüfen, ob der Benutzer berechtigt ist. –