Accessing Request Header in Java
In Java, HTTP request headers can be accessed by the following methods of the HttpServletRequest interface.
- getHeaderNames
- getHeader
- getHeaders
To access the value of a header associated with a given name getHeader() is used. In case there are multiple values associated with a given name getHeaders() is used such as cachecontrol header. getHeaders() returns an enumeration of the string object associate with a given header name. If getHeader() is used to access the header having multiple values then the first value will be returned.
0 comments:
Please give your valuable comments.