On Tue, Nov 22, 2011 at 10:50 AM, Sergey Beryozkin <[email protected]> wrote:
> Hi Benson
>
> On 22/11/11 14:40, Benson Margulies wrote:
>>
>> Does the standard demand that the default setting of accept for
>> WebClient be text/xml? This seems completely arbitrary to me. Why not
>> */*?
>
> I though it would more likely lead to some unexpected responses, say
> if you have the server code like this:
>
> public class Resource {
>
> @GET @Produces("application/xml", "application/json")
> public Book getBook() {}
>
> @GET @Produces("text/plain")
> public String getString() {}
> }
>
> then I'm not sure what is going to happen with "Accept: */*", just
> unpredictable.
>
> So I chose an xml format by default...

I see what you mean about */*. FWIW, I'd pick 'throw an exception if
no one called accept' instead if it were up to me.


>
> Sergey
>
>

Reply via email to