HTTP request headers and Response headers

Source: Internet
Author: User
Tags locale

This article briefly summarizes the HTTP request headers and response headers, and uses the response headers in some web development cases.

1. HTTP request Header

Accept: The browser uses this header to tell the server what type of data it supports. such as: text/html, Image/jpeg
Accept-charset: The browser tells the server through this header which character set it supports.
Accept-encoding: The browser tells the server through this header which compression format it supports.
Accept-language: The browser tells the server through this header, its locale.
Host: The browser tells the server through this header which host it wants to access.
If-modified-since: The browser tells the server through this header that the time to cache the data
Referer: The browser tells the server through this header which page the client is on (anti-theft chain).
Connection: The browser tells the server through this header whether to disconnect or maintain the link after the request is completed.

2. HTTP response Header

Location: The server tells the browser where to jump through this header.
Server: This header tells the browser server the model number.
Content-encoding: The server tells the browser the compression format of the data through this header.
Content-length: The server tells the browser the length of the loopback data through this header.
Content-language: The server tells the browser locale through this header.
Content-type: The server tells the browser the type of the loopback data through this header.
Refresh: The server tells the browser to refresh periodically through this header.
Content-disposition: The server uses this header to tell the browser to open the data in the following way.
Transfer-encoding: The server uses this header to tell the browser that data is being echoed back in chunks.
The following three indicates that the server tells the browser not to cache through this header
Expires:-1
Cache-control:no-cache
Pragma:no-cache

3. HTTP Response Status Code

100-199: Indicates a successful receive request, requiring the client to continue submitting the next request in order to complete the process
200-299: Indicates a successful receive request and has completed the entire process, commonly used 200
300-399: The request is not completed, the customer needs further refinement of the request, commonly used 302,307,304
400-499: Client request has errors, common 404
500-599: Error on server side, common 500

HTTP request headers and Response headers

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.