Working with IBM MobileFirst 8.0 platform, I'm exploring the option of calling a Java adapter endpoint from other Java adapter endpoint.
The example that IBM explains (here) is pretty simple and works fine for a GET method. It is, simplifying, as follows:
String otherAdapterUrlendPoint = "/otherAdapter/endpoint?param="+param;
HttpUriRequest req = new HttpGet(otherAdapterUrlendPoint);
HttpResponse response = adaptersAPI.executeAdapterRequest(req);
Question here is what happens with a POST method (or PUT or DELETE)? I have not found any documentation, neither examples. I though it could be like this:
HttpPost httpPost = new HttpPost(otherAdapterUrlendPoint);
...
<<do something with httpPost object>>
...
HttpUriRequest req = httpPost;
HttpResponse response = adaptersAPI.executeAdapterRequest(req);
but I'm not sure about how to add the json body to this request... (about headers I guess I can use method httpPost.addHeader(name, value) );
Could anybody help me with this doubt? I'm pretty sure it is not an IBM MobileFirst topic, but a Java topic...
Thanks in advance!