This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where I will use reponse.setHeader and response.setIntHeader

 
Layla Rashid
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

If I want to set content-lent is 128 then which method I will use.

response.setHeader("Content-length","128") or response.setIntHeader("Content-lenght",128)

Thanks
Layla
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
either of those would work here, since the setIntHeader() method is just a convenience wrapper, internally it would do a String.valueOf(int) to render the int value as a String into the HTTP header.

Though, technically, at the spot where you are setting these content length headers, you could just call


This will set the HTTP header Content-Type for you in the same manner as these setHeader methods.
 
Layla Rashid
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic