Getting started Community Training Tutorials Documentation APIs, AI & Tools
public void request(String url, @Connection HttpClient client, @Content InputStream body, (1)
CompletionCallback<InputStream, HttpAttributes> callback ) { (2)
client.sendAsync(HttpRequest.builder()
.uri(url)
.method("POST")
.entity(new InputStreamHttpEntity(body))
.build()).whenComplete((response, e) -> {
if (e != null) {
callback.error(e); (4)
} else {
callback.success(Result.<InputStream, HttpAttributes>builder() (3)
.output(response.getEntity().getContent())
.attributes(toAttributes(response))
.build());
}
});
}



