Class HTTPClient

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, RESTClient

    public class HTTPClient
    extends java.lang.Object
    implements RESTClient
    An HttpClient for usage with the REST catalog.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HTTPClient.Builder  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static HTTPClient.Builder builder​(java.util.Map<java.lang.String,​java.lang.String> properties)  
      void close()  
      <T extends RESTResponse>
      T
      delete​(java.lang.String path, java.lang.Class<T> responseType, java.util.Map<java.lang.String,​java.lang.String> headers, java.util.function.Consumer<ErrorResponse> errorHandler)  
      <T extends RESTResponse>
      T
      delete​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> queryParams, java.lang.Class<T> responseType, java.util.Map<java.lang.String,​java.lang.String> headers, java.util.function.Consumer<ErrorResponse> errorHandler)  
      <T extends RESTResponse>
      T
      get​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> queryParams, java.lang.Class<T> responseType, java.util.Map<java.lang.String,​java.lang.String> headers, java.util.function.Consumer<ErrorResponse> errorHandler)  
      void head​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> headers, java.util.function.Consumer<ErrorResponse> errorHandler)  
      <T extends RESTResponse>
      T
      post​(java.lang.String path, RESTRequest body, java.lang.Class<T> responseType, java.util.Map<java.lang.String,​java.lang.String> headers, java.util.function.Consumer<ErrorResponse> errorHandler)  
      <T extends RESTResponse>
      T
      post​(java.lang.String path, RESTRequest body, java.lang.Class<T> responseType, java.util.Map<java.lang.String,​java.lang.String> headers, java.util.function.Consumer<ErrorResponse> errorHandler, java.util.function.Consumer<java.util.Map<java.lang.String,​java.lang.String>> responseHeaders)  
      <T extends RESTResponse>
      T
      postForm​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> formData, java.lang.Class<T> responseType, java.util.Map<java.lang.String,​java.lang.String> headers, java.util.function.Consumer<ErrorResponse> errorHandler)  
      • Methods inherited from class java.lang.Object

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

      • head

        public void head​(java.lang.String path,
                         java.util.Map<java.lang.String,​java.lang.String> headers,
                         java.util.function.Consumer<ErrorResponse> errorHandler)
        Specified by:
        head in interface RESTClient
      • get

        public <T extends RESTResponse> T get​(java.lang.String path,
                                              java.util.Map<java.lang.String,​java.lang.String> queryParams,
                                              java.lang.Class<T> responseType,
                                              java.util.Map<java.lang.String,​java.lang.String> headers,
                                              java.util.function.Consumer<ErrorResponse> errorHandler)
        Specified by:
        get in interface RESTClient
      • post

        public <T extends RESTResponse> T post​(java.lang.String path,
                                               RESTRequest body,
                                               java.lang.Class<T> responseType,
                                               java.util.Map<java.lang.String,​java.lang.String> headers,
                                               java.util.function.Consumer<ErrorResponse> errorHandler)
        Specified by:
        post in interface RESTClient
      • post

        public <T extends RESTResponse> T post​(java.lang.String path,
                                               RESTRequest body,
                                               java.lang.Class<T> responseType,
                                               java.util.Map<java.lang.String,​java.lang.String> headers,
                                               java.util.function.Consumer<ErrorResponse> errorHandler,
                                               java.util.function.Consumer<java.util.Map<java.lang.String,​java.lang.String>> responseHeaders)
        Specified by:
        post in interface RESTClient
      • delete

        public <T extends RESTResponse> T delete​(java.lang.String path,
                                                 java.lang.Class<T> responseType,
                                                 java.util.Map<java.lang.String,​java.lang.String> headers,
                                                 java.util.function.Consumer<ErrorResponse> errorHandler)
        Specified by:
        delete in interface RESTClient
      • delete

        public <T extends RESTResponse> T delete​(java.lang.String path,
                                                 java.util.Map<java.lang.String,​java.lang.String> queryParams,
                                                 java.lang.Class<T> responseType,
                                                 java.util.Map<java.lang.String,​java.lang.String> headers,
                                                 java.util.function.Consumer<ErrorResponse> errorHandler)
        Specified by:
        delete in interface RESTClient
      • postForm

        public <T extends RESTResponse> T postForm​(java.lang.String path,
                                                   java.util.Map<java.lang.String,​java.lang.String> formData,
                                                   java.lang.Class<T> responseType,
                                                   java.util.Map<java.lang.String,​java.lang.String> headers,
                                                   java.util.function.Consumer<ErrorResponse> errorHandler)
        Specified by:
        postForm in interface RESTClient
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • builder

        public static HTTPClient.Builder builder​(java.util.Map<java.lang.String,​java.lang.String> properties)