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

Moderator: admin

Post Reply
ETS User

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

Post 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"?

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 136 guests