The server-side response is 302 Found. Can I get this status code in the ajax callback function? Can I get the Location value from ResponseHeaders for redirection? Let's write the code together to see the actual situation. In an ajax request, if the
In an ajax request, if the server-side response is 302 Found, can this status code be obtained in the ajax callback function? Can I get the Location value from Response Headers for redirection? Let's take a look at the actual situation.The
Document directory
What is HTTP headers?
Example
How to view HTTP headers
HTTP request Structure
Post: send data to the server
Head: receive header information
HTTP Response Structure
Host
User-Agent
Accept-Language
Accept-Encoding
This article systematically describes HTTP headers in a concise and easy-to-understand manner.What is HTTP headers?
HTTP is written by "Hypertext Transfer Protocol". This protocol is used throughout the world wide web. Most of the content you see in
PHP uses CURL to obtain the address instance after the 302 jump. Directly run the code: Copy the code as follows: * return a 302 address * functioncurl_post_302 ($ url, $ vars) {$ chcurl_init (); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Whether it's doing the front end or the back end, you'll have to deal with HTTP headers, and it's definitely helpful for web development. This article allows me to study the side of the HTTP headers.
What is HTTP Headers
HTTP is written by
HTTP request Header Overview (HttpServletRequest) An HTTP client (for example, a browser) that must indicate the type of request (typically get or post) when sending a request to the server. If necessary, the client can also choose to send another
Think of a requirement like this:When using Nginx reverse proxy, we need to cache the content pulled from the back-end server, under normal circumstances, if the required content is on the back-end server, then it is easy to use NginxThe Proxy_cache
This article mainly introduces PHP using curl to get 302 of the address instance after the jump, need friends can refer to the following
Directly on the code:
The code is as follows:
/* Return a 302 address * *
function curl_post_302 ($url,
In IIS has a concept called the host head, we basically have mastered, there is a concept called HTTP head, some students have asked me this question, in fact, the HTTP header more involved in the software of Dongdong.
The most intuitive HTTP header
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.