
uk.co.mruoc.camunda.client.RequestExecutor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of camunda-rest-client Show documentation
Show all versions of camunda-rest-client Show documentation
Template repo to speed up creating new library projects
The newest version!
package uk.co.mruoc.camunda.client;
import java.io.IOException;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@RequiredArgsConstructor
public class RequestExecutor {
private final HttpClient client;
public RequestExecutor() {
this(HttpClient.newHttpClient());
}
public HttpResponse execute(HttpRequest request) {
try {
log.info("sending http request {}", request);
return client.send(request, HttpResponse.BodyHandlers.ofString());
} catch (IOException e) {
throw new CamundaClientException(e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new CamundaClientException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy