This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15211|Reply: 0

[Jquery] jquery ajax to get the response header

[Copy link]
Posted on 2/1/2021 11:54:44 AM | | | |
Scenario: Using Ajax to call the interface, some additional information is in the response headers, how does Ajax get the information in the response headers?

The code is as follows:

Get the specified response header information:



In the case of cross-domain (cors), we will not be able to obtain custom response headers, we need to add "Access-Control-Expose-Headers" response headers, the C# code is as follows:

php sample code:

Response Headers access-control-expose-headers lists which headers can be exposed to the outside as part of the response.
Resources:The hyperlink login is visible.




Previous:Windows uses NC commands to test whether the UDP port is connected
Next:Deploy applications as Windows services through NSSM
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com