Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

headers

 
Ken Sampson
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anybody please help me to understand the use of the following methods.

response.addheader(...)
response.setHeader(...)

Can I use the above methods in setting any custom header esp.

response.setHeader("foo", "bar");
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good place to start is the API

See if this helps.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ken Sampson:


Can I use the above methods in setting any custom header esp.

response.setHeader("foo", "bar");


First, you can through the API in the link what Ben had provided.

Next, you have misunderstood the "attributes" vs "headers". You can definitely set your own (user defined) attributes, but not the user-defined headers.

Because the "headers" are some predefined attributes which are standardized and understood/interpreted by the browser (client) as the way it is supposed to be. Even if you gonna add your own header, there would be no purpose/use of it as the browser may not understand what it means.
[ May 21, 2008: Message edited by: Raghavan Muthu ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raghavan Muthu:

Next, you have misunderstood the "attributes" vs "headers". You can definitely set your own (user defined) attributes, but not the user-defined headers.


I'm not sure how you came to this conclusion.
I don't see enough information in Ken's post indicate a confusion between headers and attributes.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:


I'm not sure how you came to this conclusion.
I don't see enough information in Ken's post indicate a confusion between headers and attributes.


Ben, it was based on the below lines of OP.


Can I use the above methods in setting any custom header esp.

response.setHeader("foo", "bar");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic