users@jersey.java.net

[Jersey] Re: How to get entites (of various type) from ClientResponse

From: Francisco A. Lozano <flozano_at_gmail.com>
Date: Thu, 29 Mar 2012 09:53:47 +0200

In such case the server should ideally be returning a specific
content-type, such as application/vnd.yourcompany.Error+json or
application/vnd.yourcompany.Contact+json or something like that.


Francisco A. Lozano



On Thu, Mar 29, 2012 at 02:54, crc32a <carlos.garza_at_rackspace.com> wrote:
> Pavel some of us are not in control of the rest api we are consuming(We can't
> create objectClass specific resources). We are forced to consume a URL that
> can return multiple types of objects. For example if you tried a GET
> /some/user operation we could expect a User.class to be returned but if the
> operation fails we could get an Error.class object that describes the error
> that occured. How would we multiplex the differen't types of objects comming
> back fro the service? I don't know what you mean by return a wrapper class.
> If you mean by write code on the rest server I can't do that I'm only
> writing the client that will consume the rest service.
>
>
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/How-to-get-entites-of-various-type-from-ClientResponse-tp6183824p7415979.html
> Sent from the Jersey mailing list archive at Nabble.com.