On Fri, Mar 23, 2012 at 12:43 AM, Richard Berger <[email protected]>wrote:
> Given code like the following... > > ClientResource commentClient = new ClientResource(...); > CommentsResource commentsResource > = commentClient.wrap(CommentsResource.class); > commentsResource.postCommentForm(form); > > is there a way to get the response code from the commentsResource? > Currently I am using: commentClient.getResponse().getStatus().getCode() - > but that requires me to > always have access to both the wrapped ClientResource and > the ClientResource. I tried casting commentsResource back to > ClientResource but that didn't work (and was probably a silly idea - but > hey, I get pretty excited when my code compiles :) :) ). > Not silly! But off in one crucial respect: You need to cast to *ClientProxy<http://www.restlet.org/documentation/2.1/jee/api/org/restlet/resource/ClientProxy.html> *, which then has a getClientResource method from which to obtain the underlying ClientResource. --tim ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2939383

