What i meant was in which function to use this function...like doGet/doPost. I am not clear where in a program to use this function.Can you show me a sample program?
To fully understand why (and how) you would want to use this method, it helps to have an idea how HTTP shuffles data back and forth. There's a wonderful Firefox extension called LiveHTTPheaders, which shows HTTP request and response headers as they are being made by the browser. If you use that to examine the response you're getting from some site, you'll notice that it contains a line that looks like "Date: Fri, 29 Jun 2007 10:22:12 GMT". That's an HTTP header with the name of "Date" and the value "Fri, 29 Jun 2007 10:22:12 GMT". Given that, can you guess why you might want to use the addDateHeader method? [ June 29, 2007: Message edited by: Ulf Dittmer ]
You're calling addDateHeader on the response object, so calling getDateHeader on the request object could not possibly return that value, now could it?
You will see that value if you observe the response with something like LiveHttpHeaders in the browser.