Package org.actioncontroller.client
Class ApiClientClassProxy
- java.lang.Object
-
- org.actioncontroller.client.ApiClientClassProxy
-
public class ApiClientClassProxy extends Object
Used to dynamically create a client implementation of a REST-ful interface defined through an Action Controller annotated interface or class (requires ByteBuddy).Usage
Given a Controller interface like the following:public interface Controller { @Get("/data") @ContentBody String getContent(@RequestParam("filter") String filter); }The following will make a request to http://example.com/data?filter=foo and return the content as a stringString baserUrl = "http://example.com/"; Controller client = ApiClientProxy.create(Controller.class, new HttpURLConnectionApiClient(baseUrl)); String response = client.getContent("foo");
-
-
Constructor Summary
Constructors Constructor Description ApiClientClassProxy()
-