Page 1 of 1

About Question com.enthuware.ets.scwcd.v5.2.124 :

Posted: Tue Jan 17, 2012 7:20 am
by ETS User
Hello

In a book i've read that:

"The method String getHeader(String name)
Returns the (first or only) value of the
specifi ed request header as a String"

The first value of the Accept header is "image/gif"".... Why does it return "image/gif, image/jpeg, image/bmp"?

Re: About Question com.enthuware.ets.scwcd.v5.2.124 :

Posted: Tue Jan 17, 2012 7:36 am
by admin
As per the JavaDoc API:
If there are multiple headers with the same name, this method returns the first head in the request. The header name is case insensitive. You can use this method with any request header.
In the given question, there is only one header with that name. The header value is a string that contains multiple values but that is different from having multiple headers with the same name.
HTH,
Paul.