HTTP Centric API - 6.2

Talend ESB Service Developer Guide

EnrichVersion
6.2
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
Installation and Upgrade
EnrichPlatform
Talend ESB

This API lets developers write the HTTP centric code. This fluent API makes it easy to modify the request URI, check the response status and headers. For example:

public class RESTClient {

   public void consumeRESTfulService(String baseAddress) {
      WebClient client = WebClient.create(baseAddress);
      client.type("application/xml").accept("application/xml");
      client.path("/book1");
      // get javax.ws.rs.core.Response directly and check the status, 
      // headers and read the Response.getEntity() input stream
      Response response = client.get();
      // back to the base address
      client.back(true);
      client.path("/book2");
        
      // get a typed response
      Book response = client.get(Book.class); 
   }

}