Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why anybody is not replying to my headers doubt  RSS feed

 
k sudheer
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i have posted a headers doubt no body is replied is there anything silly in that question.
 
k sudheer
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
headers are added to response and retrieved from request i am i right?
but both are different objects and will have different variables,then how they interchange.
can anybody give me an example for adding and reading headers

response.addHeader();
request.getHeader();

adding to responde and reading from request how?
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k sudheer wrote:hi i have posted a headers doubt no body is replied is there anything silly in that question.


Please see this for the answer.

You read headers from the request which is sent by the browser with some useful information for the server like the MIME types supported.
Similarly we add/set headers to the response to provide some useful/extra information to the browser like the content-type, content-disposition, no-cache,etc.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!