- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Can somebody explain the HTTP headers in simpler terms in JSP context?
When a Web server responds to an HTTP request, the response typically consists of a status line, some response headers, a blank line, and the document. A typical response looks like this −
HTTP/1.1 200 OK Content-Type: text/html Header2: ... ... HeaderN: ... (Blank Line) <!doctype ...> <html> <head>...</head> <body> ... </body> </html>
The status line consists of the HTTP version (HTTP/1.1 in the example), a status code (200 in the example), and a very short message corresponding to the status code (OK in the example).
Following is a summary of the most useful HTTP 1.1 response headers which go back to the browser from the web server. These headers are frequently used in web programming −
|Sr.No.||Header & Description|
This header specifies the request methods (GET, POST, etc.) that the server supports.
This header specifies the circumstances in which the response document can safely be cached. It can have values public, private or no-cache etc. Public means document is cacheable, Private means document is for a single user and can only be stored in private (nonshared) caches and no-cache means document should never be cached.
This header instructs the browser whether to use persistent HTTP connections or not. A value of close instructs the browser not to use persistent HTTP connections and keep-alive means using persistent connections.
This header lets you request that the browser ask the user to save the response to disk in a file of the given name.
This header specifies the way in which the page was encoded during transmission.
This header signifies the language in which the document is written. For example, en, en-us, ru, etc.
This header indicates the number of bytes in the response. This information is needed only if the browser is using a persistent (keep-alive) HTTP connection.
This header gives the MIME (Multipurpose Internet Mail Extension) type of the response document.
This header specifies the time at which the content should be considered out-of-date and thus no longer be cached.
This header indicates when the document was last changed. The client can then cache the document and supply a date by an If-Modified-Since request header in later requests.
This header should be included with all responses that have a status code in the 300s. This notifies the browser of the document address. The browser automatically reconnects to this location and retrieves the new document.
This header specifies how soon the browser should ask for an updated page. You can specify time in a number of seconds after which a page would be refreshed.
This header can be used in conjunction with a 503 (Service Unavailable) response to tell the client how soon it can repeat its request.
This header specifies a cookie associated with the page.
- Related Articles
- How a JSP page works. Can somebody explains the JSP architecture in simpler terms
- PHP HTTP context options
- How to read all HTTP headers in Python CGI script?
- Which methods can be used to read HTTP header in your JSP program.
- The best way to inspect HTTP response headers with Selenium
- Explain HTTP Request in Backbone.js
- What are important HTTP headers to be frequently used in Python CGI Programming?
- How to read a HTTP header using JSP?
- Explain the HTTP request-response lifecycle in ASP.NET Core.
- Explain the simplification of context free grammar in TOC
- Explain removing unit productions in context free grammar
- Explain the context free language closure under concatenation?
- Can we get the HTTP Response Code in Selenium with Java?
- Explain the context free language closure under union operation?
- Explain Pumping lemma for context free language