Class HttpService


  • public class HttpService
    extends java.lang.Object
    General purpose HTTP client service
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.http.HttpResponse<java.io.InputStream> post​(java.lang.String url, java.util.Map<java.lang.String,​java.lang.String> headers, java.io.InputStream body, java.lang.String mediaType)
      Post data to an HTTP endpoint
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpService

        public HttpService()
    • Method Detail

      • post

        @NotNull
        public java.net.http.HttpResponse<java.io.InputStream> post​(@NotNull
                                                                    java.lang.String url,
                                                                    @NotNull
                                                                    java.util.Map<java.lang.String,​java.lang.String> headers,
                                                                    @NotNull
                                                                    java.io.InputStream body,
                                                                    @NotNull
                                                                    java.lang.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