English 中文(简体)
org.restlet.Client and org.restlet.resource.ClientResource
原标题:Difference Between org.restlet.Client and org.restlet.resource.ClientResource

org.restlet.Client和org.restlet.resource.ClientResource之间的主要差别是什么?

我看到,这些班级是半交换的,因此,我主要只是想到一个一般规则,在什么时候应当使用。

最佳回答

org.restlet。 客户是低水平的促销器,以使用Relet执行REE的要求。 org.restlet.resource.ClientResource Internal use this category to actual access RESTful submissions. 因此,客户资源通常是为执行客户申请而使用的类别。

你们应当与客户资源库一起考虑的一个非常有趣的特点是能够使用下文所述附加说明的接口。

public interface MyRestfulService {
    @GET
    Contact getContact(String id);
}

现在如何利用接口:

ClientResource cr = new ClientResource("http://...");
MyRestfulService service = cr.wrap(MyRestfulService.class);
Contact contact = service.getContact("id");

你可以看到,现在一切都隐藏在你们身上(颠覆、反面......)。

Hope it helps you. Thierry

问题回答

暂无回答




相关问题
Log response-time in restlet-based webservice

What is the simplest way to log the response-time for a restlet-based webservice? I want to make sure that our webservice has a reasonable response time. So I want to be able to keep an eye on ...

Running JUnit Tests on a Restlet Router

Using Restlet I have created a router for my Java application. From using curl, I know that each of the different GET, POST & DELETE requests work for each of the URIs and return the correct JSON ...

How do I create an Atom representation with Restlet?

I want to create atom xml representations for my REST resources using Restlet. Should I (can I?) use ROME or just use the Atom extension for Restlet? What s the best way to go about this? Thanks ...

Restlet: Log Stack Trace for All 500 Errors

I d like my Restlet application to log the stack trace for any Resource that generates a 500-series HTTP error (using the Context s Logger). As far as I can tell, this is not the default behavior. In ...

Concatenate JsonRepresentation

How can I concatenate multiple JsonRepresentation Object into one, without building my own string parser? Say I have two JsonRepresentation objects obj1 = {"name":"obj1"}; obj2 = {"name":"obj2"}; ...

Restlet POST using JSON

How do I implement Restlet function which accepts JSON post? And how do I test this using curl? Thanks

Restlet ClientResource Post Chunked Encoding - WCF Unsuported

I m developing a product that will use extensively of Restlet for consume WCF Rest Services. I had created a method to post a XML of a class containing 2 attributes. Restlet post my xml with Transfer-...

热门标签