Class HttpClient

java.lang.Object
io.camunda.zeebe.client.impl.http.HttpClient
All Implemented Interfaces:
AutoCloseable

public final class HttpClient extends Object implements AutoCloseable
Thin abstraction layer on top of Apache's HTTP client to wire up the expected Zeebe API conventions, e.g. errors are always ProblemDetail, content type is always JSON, etc.
  • Constructor Details

    • HttpClient

      public HttpClient(org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient client, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, URI address, org.apache.hc.client5.http.config.RequestConfig defaultRequestConfig, int maxMessageSize, org.apache.hc.core5.util.TimeValue shutdownTimeout, CredentialsProvider credentialsProvider)
  • Method Details

    • start

      public void start()
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • newRequestConfig

      public org.apache.hc.client5.http.config.RequestConfig.Builder newRequestConfig()
      Creates a new request configuration builder with the default values. The builder can be used to customize the request configuration for a specific request.
      Returns:
      a new request configuration builder
    • get

      public <HttpT, RespT> void get(String path, Map<String,String> queryParams, org.apache.hc.client5.http.config.RequestConfig requestConfig, Class<HttpT> responseType, JsonResponseTransformer<HttpT,RespT> transformer, HttpZeebeFuture<RespT> result)
    • get

      public <HttpT, RespT> void get(String path, org.apache.hc.client5.http.config.RequestConfig requestConfig, Class<HttpT> responseType, JsonResponseTransformer<HttpT,RespT> transformer, HttpZeebeFuture<RespT> result)
    • post

      public <RespT> void post(String path, String body, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result)
    • post

      public <HttpT, RespT> void post(String path, String body, org.apache.hc.client5.http.config.RequestConfig requestConfig, Class<HttpT> responseType, JsonResponseTransformer<HttpT,RespT> transformer, HttpZeebeFuture<RespT> result)
    • post

      public <HttpT, RespT> void post(String path, Map<String,String> queryParams, String body, org.apache.hc.client5.http.config.RequestConfig requestConfig, Class<HttpT> responseType, JsonResponseTransformer<HttpT,RespT> transformer, HttpZeebeFuture<RespT> result)
    • postMultipart

      public <HttpT, RespT> void postMultipart(String path, Map<String,String> queryParams, org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder multipartBuilder, org.apache.hc.client5.http.config.RequestConfig requestConfig, Class<HttpT> responseType, JsonResponseTransformer<HttpT,RespT> transformer, HttpZeebeFuture<RespT> result)
    • postMultipart

      public <HttpT, RespT> void postMultipart(String path, org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder multipartBuilder, org.apache.hc.client5.http.config.RequestConfig requestConfig, Class<HttpT> responseType, JsonResponseTransformer<HttpT,RespT> transformer, HttpZeebeFuture<RespT> result)
    • put

      public <RespT> void put(String path, String body, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result)
    • patch

      public <RespT> void patch(String path, String body, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result)
    • delete

      public <RespT> void delete(String path, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result)
    • delete

      public <RespT> void delete(String path, Map<String,String> queryParams, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result)