Class HttpService

java.lang.Object
org.deltafi.common.http.HttpService

public class HttpService extends Object
General purpose HTTP client service
  • Constructor Details

    • HttpService

      public HttpService()
  • Method Details

    • post

      @NotNull public HttpResponse<InputStream> post(@NotNull String url, @NotNull Map<String,String> headers, @NotNull InputStream body, @NotNull String mediaType) throws HttpPostException
      Post data to an HTTP endpoint
      Parameters:
      url - URL endpoint where data will be posted
      headers - Map of key-value pairs for HTTP header fields and values
      body - Body content to be posted to the HTTP endpoint
      mediaType - Media type of the HTTP post
      Returns:
      an HTTP response object with success/failure details
      Throws:
      HttpPostException - when the HTTP client throws an IOException, InterruptedException, IllegalArgumentException , or SecurityException