ERXRestClient was just a proof of concept ... There's really no reason you couldn't just extend the APi to always use ERXKeyFilter.filterWithAllRecursive() and make a default rest delegate that just makes new instances of classes for you. That said, I think RestEasy and Jersey both do a better job on the client side for things like modeling cookie, header, and form parameters. All would be pretty easy to put into ERXRestClient, though -- we certainly have all the primitives to do it.
ms On May 18, 2011, at 10:05 AM, Pascal Robert wrote: > > Le 2011-05-18 à 09:39, Henrique Prange a écrit : > >> Pascal, >> >> Just to summarize the simplicity of Jersey client. Here is a sample code of >> how to do a GET on the resource identified by 10. >> >> Client client = Client.create(); >> >> WebResource resource = client.resource( "http://localhost/my-service" ); >> >> MyResource response = >> resource.path("resource").path(10).type(MediaType.APPLICATION_JSON).get(MyResource.class); > > RestEasy is not too bad : > > public interface SimpleClient { > > @GET > @Path("search.json") > @Produces("application/json") > ClientResponse<TwitterSearchResult> getSearchResults(@QueryParam("q") > String hashtag, @QueryParam("result_type") String resultType); > > } > SimpleClient client = ProxyFactory.create(SimpleClient.class, > "http://search.twitter.com/"); > ClientResponse<TwitterSearchResult> response = > client.getSearchResults("#wowodc","recent"); > if > (response.getResponseStatus().getFamily().equals(Response.Status.Family.SUCCESSFUL)) > { > NSLog.out.appendln(response.getEntity()); > } > > Problem is that it doesn't understand classes like NSTimestamp and NSArray. > ERXRestClient understand the WO unique stuff, but you have to write > delegates, use ERXKeyFilter, etc. But ERXRestClient is good if the service > you call is the service you are calling are following the same structure as > ERRest or RoR. > > BTW, the Twitter REST API is crap. > >> Cheers, >> >> Henrique >> >> On 18/05/2011, at 10:20, Henrique Prange wrote: >> >>> Hi Pascal, >>> >>> We have been using Jersey [1] to produce and consume REST services. We >>> found Jersey the most concise and simple REST implementation. It also >>> offers a good set of tools to test production and consumption of REST >>> services, which is essential in our development process. >>> >>> [1]http://jersey.java.net/ >>> >>> Cheers, >>> >>> Henrique >>> >>> On 18/05/2011, at 10:05, Pascal Robert wrote: >>> >>>> Good morning, >>>> >>>> I see from the 2011 surveys that a good part of the community is consuming >>>> REST services. I was wondering what are you using to consume those? Right >>>> now, I'm playing with ERXRestClient and JBoss' RestEasy to consume REST >>>> services, but I'm curious to see what other people use. Just plain Jakarta >>>> HTTPClient with a JSON or XML parser? >>>> >>>> >>>> -- >>>> Pascal Robert >>>> [email protected] >>>> >>>> WOWODC 2011 : July 1-2-3, Montreal. wowodc.com >>>> >>>> AIM/iChat : MacTICanada >>>> LinkedIn : http://www.linkedin.com/in/macti >>>> Twitter : pascal_robert >>>> >>>> >>>> >>>> _______________________________________________ >>>> Do not post admin requests to the list. They will be ignored. >>>> Webobjects-dev mailing list ([email protected]) >>>> Help/Unsubscribe/Update your Subscription: >>>> http://lists.apple.com/mailman/options/webobjects-dev/hprange%40gmail.com >>>> >>>> This email sent to [email protected] >>> >> >> _______________________________________________ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list ([email protected]) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/webobjects-dev/probert%40macti.ca >> >> This email sent to [email protected] > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40pobox.com > > This email sent to [email protected]
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
