HTTP Request Headers-Response Header field interpretation

Source: Internet
Author: User
Tags response code domain server

Request headers===========

The 1.Accept belongs to the request header, and the content-type belongs to the entity header.

The 2.Accept represents the type of data that the sender (client) wants to accept.
For example: Accept:text/xml;
The type of data you want to accept on behalf of the client is XML type

Content-type represents the data type of the entity data sent by the sender (client | server).
For example: content-type:text/html;
The data format that is sent on behalf of the sender is HTML

Post requests the data type (Content-type) can only be application/x-www-form-urlencoded, Multipart/form-data
Or one of the text/plain.

The

///Request header field is used to specify what types of information the client accepts
//the MIME type
//text/html that the browser side can accept, indicating that the client wants to accept HTML text
//image/gif. Indicates that the client wants to accept a GIF image format resource
Accept:application/json, Text/plain,/
//Specify the client-accepted character Set
//If the domain is not set in the request message, By default, any character set can accept the
accept-charset:iso-8859-1,gb2312
//acceptable content encoding
//If the domain server is not set in the request message, the client is assumed to be acceptable for various content encodings.
Accept-encoding:gzip, deflate, BR
//Specifies that a natural language is not set to accept all
accept-language:zh-cn,zh;q=0.8
//For specifying caching directives, Caching instructions are one-way
//eg: to instruct IE browsers (clients) not to cache pages, server-side JSP programs can be written as follows: Response.sehheader ("Cache-control", "No-cache");
Cache-control:no-cache//is used to indicate that a request or response message cannot be cached
//Normal header field allows you to send the option of a specified connection
Connection:keep-alive//Represents a long time connection Whether the disconnect is a client-server thing developers do not have to manage
//
Content-length:14
content-type:application/x-www-form-urlencoded;charset= UTF-8
Cookie:jsessionid=fd926141ab8190f29f9e39da96434b71
//Specify the Internet host and port number of the requested resource
Host:localhost

Origin:http://localhost
Specifying a "No-cache" value indicates that the server must return a refreshed document, even if it is a proxy server and has a local copy of the page
Pragma:no-cache
Referer is visible in the headers part of the HTTP request.

Referer http://www.baidu.com/s?tn=98835442_hao_pg&ie=utf-8&f=3&wd=126.com&oq=126.&bs=126. Com&rsv_bp=1&inputt=5799&rsp=0

HTTP protocol header Referer is mainly used to let the server determine the source page, that is, the user from which page, usually by the site used to statistics the user source, from the search page, or from other sites linked to the link, or from the bookmarks and other visits, so that the site reasonable positioning.

Referer is sometimes used as an anti-theft chain, that is, when downloading the source address is not within the site domain name,
Otherwise can not download or display, many sites, such as the Tianya is through the Referer page to determine whether the user can
Download the picture.
Referer:http://localhost/portalmgr/home.html?input1=&input2=
Allows clients to tell the server about its operating system, browser, and other properties
user-agent:mozilla/5.0 (Windows NT 10.0; WOW64) applewebkit/537.36 (khtml, like Gecko) chrome/55.0.2883.87 safari/537.36

Response headers===========

Access-control-allow-headers:content-type
Access-control-allow-methods:post
access-control-allow-origin:* the
//server supports which request methods (such as GET, post, etc.).
Allow:post
Cache-control:no-cache, No-store, max-age=0, must-revalidate
connection:keep-alive
content-length:537
//Indicates the media type of the entity body sent to the recipient
//web server tells the browser the type of object it responds to and the character set
Content-type:application/json; Charset=utf-8
//Indicates when the message was sent
Date:tue, Dec 2016 08:37:10 GMT
//Response expiration date and time
//To have the proxy server or browser update the cache after a period of time (again When accessing pages that have been visited directly from the cache, shortening response time, and reducing server load, we can use the Expires Entity header field to specify when the page expires
//To allow the browser not to cache the page, we can also use the Expires Entity header field, set to 0 , the JSP procedures are as follows: Response.setdateheader ("Expires", "0");
expires:0
Keep-alive:timeout=5, max=95
//Specifies a "No-cache" value indicating that the server must return a refreshed document, even if it is a proxy server and has a local copy of the page
Pragma:no-cache
server:apache/2.4.23 (Win64)
x-application-context:portal-wifidog:development:8080
X-content-type-options:nosniff
X-frame-options:deny
X-xss-protection:1; Mode=block

Server Response Code
//client request succeeded
Bad Request//client request has syntax error, cannot be understood by server
401 Unauthorized//request unauthorized, this status code must and Www-au The Thenticate header field is used with the
403 Forbidden/server to receive the request, but to deny the service
404 Not Found//request resource does not exist, eg: the wrong URL was entered
Internal Server Errors//server Unexpected error
503 Server unavailable//server is currently unable to process client requests and may revert to normal after a period of time

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.