|
From: Bill B. <bb...@re...> - 2008-06-05 17:29:07
|
I think I'm going to have to define my own Response interface/class.
The problem with Response is that it has no type information within it
so I have no idea how to unmarshal the returned entity/messagebody.
Plus all the set() methods it has doesn't make sense, it should be
immutable.
I'm thinking:
package org.resteasy;
public interface ClientResponse<T>
{
<T> T getEntity();
MultivaluedMap<String, String> getHeaders();
int getStatus();
}
I'll fool around with something today and get back to you.
Bill
Christian Sadilek wrote:
> 1. is the way I originally hoped it would work. To have the response
> object available on the client would be beautiful. It would offer easy
> access to the status and entity.
>
> thanks,
> Christian
>
> 2008/6/5 Bill Burke <bb...@re... <mailto:bb...@re...>>:
>
> I haven't put a lot of thought into this. I guess have two things:
>
> 1. Allow return of a Response object in the client framework.
> 2. An method annotation that says that the return value is a status
> code @StatusCode or something
> 3. Allow returning a Response.Status enum
> 4. Throw a WebApplicationExceptoin iif, the response falls into an
> error code bucket.
>
> Thoughts?
>
>
>
>
>
> Christian Sadilek wrote:
>
> The HttpClientInvoker throws a RuntimeException when a status
> other then SC_OK is returned by the executed method. What if the
> method returns Response.created(uri).build()? Why should the
> HttpClientInvoker throw an exception in case of SC_CREATED (201)?
>
> In general how do I check if the request went well? Is there a
> way to retrieve the http status code on the client?
>
> Thanks,
> Christian
>
>
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> <mailto:Res...@li...>
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|