Does anyone know how to add or create a custom HTTP header using JavaScript or jQuery?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- Carriage Return (ASCII chr 13) is missing from tex
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
"setRequestHeader" method of XMLHttpRequest object should be used
http://help.dottoro.com/ljhcrlbv.php
Or, if you want to send the custom header for every future request, then you could use the following:
This way every future ajax request will contain the custom header, unless explicitly overridden by the options of the request. You can find more info on
ajaxSetup
here