• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlets  RSS feed

 
rupika deval
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are request headers and why are they necessary
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
google servlets basics+request headers, forums are to help you resolve your problems use them wisely.

-P
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better yet, look at the HTTP spec.
http://www.w3.org/Protocols/rfc2616/rfc2616.html

In a nutshell, an HTTP request (and a response) is a stream of text pushed from the client to the server. The lines after the first line (which contains the URL, and HTTP version number) are headers. Each header is a name/value pair. The name and value are separated with a ':' symbol. The headers are separated by a newline character. Once all the headers have been sent, the client sends two blank lines to signal the end of the headers and the beginning of the body if there is one.

The response is almost the exact same thing but send from the server back to the client.

The purpose of the headers is to allow the client and the server to describe the data being sent back and forth and to communicate what each expects from the other.

If you would like to see these headers in action, download and install the LiveHttpHeaders plugin for FireFox.
It's a great tool for debugging web development issues.



Here are all the headers that get passed back and forth from browser to server when a request is made to Google (searching for LiveHttpHeaders):


[ June 04, 2008: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
143
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

This whole forum is devoted to questions on servlets, so a subject of "Servlets" is less than useless. Do you not think that "What are request headers" would have been a better title?

You can go back and change your post to add a more meaningful subject by clicking the .
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!