Divya
Joined: 14 Sep 2009 Posts: 57
|
Posted: Mon Dec 07, 2009 6:27 am Post subject: HTTP Headers in HTTP Responses |
|
|
-------------------HTTP Headers in HTTP Responses-------------------
Earlier i have been posted about the HTTP Headers Requests and there uses .
Now we are going to look at some of the most common HTTP headers found in HTTP responses.
You can see the headers that are sent, or will be sent, with the headers_list() function. You can check if the headers have been sent already, with the headers_sent() function.
The following are the different types of HTTP Responses :
1.Cache-Control:
The Cache-Control general-header field is used to specify directives which MUST be obeyed by all caching mechanisms along the request/response chain." These "caching mechanisms" include gateways and proxies that your ISP may be using.
2.Content-Type
This header indicates the "mime-type" of the document. The browser then decides how to interpret the contents based on this.
3.Content-Disposition
This header instructs the browser to open a file download box, instead of trying to parse the content.
4.Content-Length
When content is going to be transmitted to the browser, the server can indicate the size of it (in bytes) using this header.
5.Etag
This is another header that is used for caching purposes.
6.Last-Modified
As the name suggests, this header indicates the last modify date of the document, in GMT format.
7.Location
This header is used for redirections. If the response code is 301 or 302, the server must also send this header.
8.Set-Cookie
When a website wants to set or update a cookie in your browser, it will use this header.
Each cookie is sent as a separate header. Note that the cookies set via JavaScript do not go through HTTP headers.
9.WWW-Authenticate
A website may send this header to authenticate a user through HTTP. When the browser sees this header, it will open up a login dialogue window.
10.Content-Encoding
This header is usually set when the returned content is compressed.
These are the ten different types of HTTP Responses when a browser requests for response.
Thanks for reading,
Divya. |
|