Class HttpOp


  • public class HttpOp
    extends java.lang.Object
    Simplified HTTP operations; simplification means only supporting certain uses of HTTP. The expectation is that the simplified operations in this class can be used by other code to generate more application specific HTTP interactions (e.g. SPARQL queries). For more complicated requirements of HTTP, then the application will need to use org.apache.http.client directly.

    For HTTP GET, the application supplies a URL, the accept header string, and a list of handlers to deal with different content type responses.

    For HTTP POST, the application supplies a URL, content, the accept header string, and a list of handlers to deal with different content type responses, or no response is expected.

    For HTTP PUT, the application supplies a URL, content, the accept header string

    See Also:
    HttpNames, for HTTP related constants, WebContent, for content type name constants
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HttpOp.CaptureInput
      TypedInputStream from an HTTP response.
      static class  HttpOp.CaptureString
      Capture response as a string (UTF-8 assumed)
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpOp()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void applyUserAgent​(org.apache.http.HttpMessage message)
      Applies the configured User-Agent string to the HTTP request
      static org.apache.http.impl.client.CloseableHttpClient createCachingHttpClient()
      Create an HttpClient that performs client-side caching and connection pooling.
      static org.apache.http.client.HttpClient createDefaultHttpClient()  
      static org.apache.http.impl.client.CloseableHttpClient createPoolingHttpClient()
      Create an HttpClient that performs connection pooling.
      static org.apache.http.impl.client.HttpClientBuilder createPoolingHttpClientBuilder()
      Create an HttpClientBuilder that performs connection pooling.
      static void execHttpDelete​(java.lang.String url)
      Executes a HTTP DELETE operation
      static void execHttpDelete​(java.lang.String url, HttpResponseHandler handler)
      Executes a HTTP DELETE operation
      static void execHttpDelete​(java.lang.String url, HttpResponseHandler handler, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP DELETE operation
      static TypedInputStream execHttpGet​(java.lang.String url)
      Executes a HTTP GET and return a TypedInputStream.
      static TypedInputStream execHttpGet​(java.lang.String url, java.lang.String acceptHeader)
      Executes a HTTP GET and return a TypedInputStream.
      static TypedInputStream execHttpGet​(java.lang.String url, java.lang.String acceptHeader, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP GET and returns a TypedInputStream
      static void execHttpGet​(java.lang.String url, java.lang.String acceptHeader, HttpResponseHandler handler)
      Executes a HTTP Get request, handling the response with given handler.
      static void execHttpGet​(java.lang.String url, java.lang.String acceptHeader, HttpResponseHandler handler, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP Get request handling the response with one of the given handlers
      static java.lang.String execHttpGetString​(java.lang.String url)
      Convenience operation to execute a GET with no content negotiation and return the response as a string.
      static java.lang.String execHttpGetString​(java.lang.String url, java.lang.String acceptHeader)
      Convenience operation to execute a GET and return the response as a string
      static void execHttpHead​(java.lang.String url)
      Executes a HTTP HEAD operation
      static void execHttpHead​(java.lang.String url, java.lang.String acceptString, HttpResponseHandler handler)
      Executes a HTTP HEAD operation
      static void execHttpHead​(java.lang.String url, java.lang.String acceptString, HttpResponseHandler handler, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP HEAD operation
      static void execHttpPost​(java.lang.String url, java.lang.String contentType, java.io.InputStream input, long length)
      Executes a HTTP POST with a request body from an input stream without response body with no response handling
      static void execHttpPost​(java.lang.String url, java.lang.String contentType, java.io.InputStream input, long length, java.lang.String acceptType, HttpResponseHandler handler)
      Executes a HTTP POST with request body from an input stream and response handling.
      static void execHttpPost​(java.lang.String url, java.lang.String contentType, java.io.InputStream input, long length, java.lang.String acceptType, HttpResponseHandler handler, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP POST with request body from an input stream and response handling.
      static void execHttpPost​(java.lang.String url, java.lang.String contentType, java.lang.String content)
      Executes a HTTP POST with the given contentype/string as the request body and throws away success responses, failure responses will throw an error.
      static void execHttpPost​(java.lang.String url, java.lang.String contentType, java.lang.String content, java.lang.String acceptType, HttpResponseHandler handler, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP POST with a string as the request body and response handling
      static void execHttpPost​(java.lang.String url, java.lang.String contentType, java.lang.String content, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP POST with a string as the request body and response handling
      static void execHttpPost​(java.lang.String url, org.apache.http.HttpEntity entity)
      Executes a HTTP POST of the given entity
      static void execHttpPost​(java.lang.String url, org.apache.http.HttpEntity entity, java.lang.String acceptString, HttpResponseHandler handler)
      Executes a HTTP Post
      static void execHttpPost​(java.lang.String url, org.apache.http.HttpEntity entity, java.lang.String acceptHeader, HttpResponseHandler handler, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      POST with response body.
      static void execHttpPost​(java.lang.String url, org.apache.http.HttpEntity entity, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      POST with response body.
      static void execHttpPostForm​(java.lang.String url, Params params)
      Executes a HTTP POST.
      static void execHttpPostForm​(java.lang.String url, Params params, java.lang.String acceptString, HttpResponseHandler handler)
      Executes a HTTP POST form operation
      static void execHttpPostForm​(java.lang.String url, Params params, java.lang.String acceptHeader, HttpResponseHandler handler, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP POST form operation
      static TypedInputStream execHttpPostFormStream​(java.lang.String url, Params params, java.lang.String acceptHeader)
      Executes a HTTP POST and returns a TypedInputStream, The TypedInputStream must be closed.
      static TypedInputStream execHttpPostFormStream​(java.lang.String url, Params params, java.lang.String acceptHeader, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP POST Form and returns a TypedInputStream
      static TypedInputStream execHttpPostStream​(java.lang.String url, java.lang.String contentType, java.lang.String content, java.lang.String acceptType)
      Execute a HTTP POST and return the typed return stream.
      static TypedInputStream execHttpPostStream​(java.lang.String url, java.lang.String contentType, java.lang.String content, java.lang.String acceptType, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)  
      static TypedInputStream execHttpPostStream​(java.lang.String url, org.apache.http.HttpEntity entity, java.lang.String acceptHeader)
      Execute a HTTP POST and return the typed return stream.
      static TypedInputStream execHttpPostStream​(java.lang.String url, org.apache.http.HttpEntity entity, java.lang.String acceptHeader, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      POST with response body.
      static void execHttpPut​(java.lang.String url, java.lang.String contentType, java.io.InputStream input, long length)
      Executes a HTTP PUT operation
      static void execHttpPut​(java.lang.String url, java.lang.String contentType, java.io.InputStream input, long length, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP PUT operation
      static void execHttpPut​(java.lang.String url, java.lang.String contentType, java.lang.String content)
      Executes a HTTP PUT operation
      static void execHttpPut​(java.lang.String url, java.lang.String contentType, java.lang.String content, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP PUT operation
      static void execHttpPut​(java.lang.String url, org.apache.http.HttpEntity entity)
      Executes a HTTP PUT operation
      static void execHttpPut​(java.lang.String url, org.apache.http.HttpEntity entity, org.apache.http.client.HttpClient httpClient, org.apache.http.protocol.HttpContext httpContext)
      Executes a HTTP PUT operation
      static org.apache.http.client.HttpClient getDefaultHttpClient()
      Return the current default HttpClient.
      static java.lang.String getUserAgent()
      Gets the User-Agent string that ARQ is applying to all HTTP requests
      static java.lang.String readPayload​(org.apache.http.HttpEntity entity)  
      static void setDefaultHttpClient​(org.apache.http.client.HttpClient client)
      Performance can be improved by using a shared HttpClient that uses connection pooling.
      static HttpRequestTransformer setRequestTransformer​(HttpRequestTransformer tform)
      Setting an HttpRequestTransformer allows manipulation or enhancement of HTTP requests.
      static void setUserAgent​(java.lang.String userAgent)
      Sets the User-Agent string that ARQ will apply to all HTTP requests
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • initialDefaultHttpClient

        public static final org.apache.http.client.HttpClient initialDefaultHttpClient
        Used to reset defaultHttpClient when needed
      • ARQ_USER_AGENT

        public static final java.lang.String ARQ_USER_AGENT
        Constant for the default User-Agent header that ARQ will use
    • Constructor Detail

      • HttpOp

        public HttpOp()
    • Method Detail

      • createDefaultHttpClient

        public static org.apache.http.client.HttpClient createDefaultHttpClient()
      • getDefaultHttpClient

        public static org.apache.http.client.HttpClient getDefaultHttpClient()
        Return the current default HttpClient. This may be null, meaning a new HttpClient is created each time, if none is provided in the HttpOp function call.
        Returns:
        Default HTTP Client
      • setDefaultHttpClient

        public static void setDefaultHttpClient​(org.apache.http.client.HttpClient client)
        Performance can be improved by using a shared HttpClient that uses connection pooling. However, pool management is complicated and can lead to starvation (the system locks-up, especially on Java6; it's JVM sensitive). See the Apache HTTP Commons Client documentation for more details.
        Parameters:
        client - HTTP client to use, if this is null, reset to original default instead
      • setRequestTransformer

        public static HttpRequestTransformer setRequestTransformer​(HttpRequestTransformer tform)
        Setting an HttpRequestTransformer allows manipulation or enhancement of HTTP requests.
        Parameters:
        tform - HttpRequestTransformer to use, null for none (the default)
        Returns:
        the previous HttpRequestTransformer in use
      • createPoolingHttpClient

        public static org.apache.http.impl.client.CloseableHttpClient createPoolingHttpClient()
        Create an HttpClient that performs connection pooling. This can be used with setDefaultHttpClient(org.apache.http.client.HttpClient) or provided in the HttpOp calls.
      • createPoolingHttpClientBuilder

        public static org.apache.http.impl.client.HttpClientBuilder createPoolingHttpClientBuilder()
        Create an HttpClientBuilder that performs connection pooling.
      • createCachingHttpClient

        public static org.apache.http.impl.client.CloseableHttpClient createCachingHttpClient()
        Create an HttpClient that performs client-side caching and connection pooling. This can be used with setDefaultHttpClient(org.apache.http.client.HttpClient) or provided in the HttpOp calls. Beware that content is cached in this process, including across remote server restart.
      • getUserAgent

        public static java.lang.String getUserAgent()
        Gets the User-Agent string that ARQ is applying to all HTTP requests
        Returns:
        User-Agent string
      • setUserAgent

        public static void setUserAgent​(java.lang.String userAgent)
        Sets the User-Agent string that ARQ will apply to all HTTP requests
        Parameters:
        userAgent - User-Agent string
      • execHttpGet

        public static void execHttpGet​(java.lang.String url,
                                       java.lang.String acceptHeader,
                                       HttpResponseHandler handler)
        Executes a HTTP Get request, handling the response with given handler.

        HTTP responses 400 and 500 become exceptions.

        Parameters:
        url - URL
        acceptHeader - Accept Header
        handler - Response Handler
      • execHttpGet

        public static void execHttpGet​(java.lang.String url,
                                       java.lang.String acceptHeader,
                                       HttpResponseHandler handler,
                                       org.apache.http.client.HttpClient httpClient,
                                       org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP Get request handling the response with one of the given handlers

        The acceptHeader string is any legal value for HTTP Accept: field.

        The handlers are the set of content types (without charset), used to dispatch the response body for handling.

        HTTP responses 400 and 500 become exceptions.

        Parameters:
        url - URL
        acceptHeader - Accept Header
        handler - Response handler called to process the response
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpGet

        public static TypedInputStream execHttpGet​(java.lang.String url)
        Executes a HTTP GET and return a TypedInputStream. The stream must be closed after use.

        The acceptHeader string is any legal value for HTTP Accept: field.

        Parameters:
        url - URL
        Returns:
        TypedInputStream
      • execHttpGet

        public static TypedInputStream execHttpGet​(java.lang.String url,
                                                   java.lang.String acceptHeader)
        Executes a HTTP GET and return a TypedInputStream. The stream must be closed after use.

        The acceptHeader string is any legal value for HTTP Accept: field.

        Parameters:
        url - URL
        acceptHeader - Accept Header
        Returns:
        TypedInputStream or null if the URL returns 404.
      • execHttpGet

        public static TypedInputStream execHttpGet​(java.lang.String url,
                                                   java.lang.String acceptHeader,
                                                   org.apache.http.client.HttpClient httpClient,
                                                   org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP GET and returns a TypedInputStream

        A 404 will result in a null stream being returned, any other error code results in an exception.

        Parameters:
        url - URL
        acceptHeader - Accept Header
        httpClient - HTTP Client
        httpContext - HTTP Context
        Returns:
        TypedInputStream or null if the URL returns 404.
      • execHttpGetString

        public static java.lang.String execHttpGetString​(java.lang.String url)
        Convenience operation to execute a GET with no content negotiation and return the response as a string.
        Parameters:
        url - URL
        Returns:
        Response as a string
      • execHttpGetString

        public static java.lang.String execHttpGetString​(java.lang.String url,
                                                         java.lang.String acceptHeader)
        Convenience operation to execute a GET and return the response as a string
        Parameters:
        url - URL
        acceptHeader - Accept header.
        Returns:
        Response as a string
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        java.lang.String contentType,
                                        java.lang.String content)
        Executes a HTTP POST with the given contentype/string as the request body and throws away success responses, failure responses will throw an error.
        Parameters:
        url - URL
        contentType - Content Type to POST
        content - Content to POST
      • execHttpPostStream

        public static TypedInputStream execHttpPostStream​(java.lang.String url,
                                                          java.lang.String contentType,
                                                          java.lang.String content,
                                                          java.lang.String acceptType)
        Execute a HTTP POST and return the typed return stream.
        Parameters:
        url - URL
        contentType - Content Type to POST
        content - Content to POST
        acceptType - Accept Type
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        java.lang.String contentType,
                                        java.lang.String content,
                                        org.apache.http.client.HttpClient httpClient,
                                        org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP POST with a string as the request body and response handling
        Parameters:
        url - URL
        contentType - Content Type to POST
        content - Content to POST
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPostStream

        public static TypedInputStream execHttpPostStream​(java.lang.String url,
                                                          java.lang.String contentType,
                                                          java.lang.String content,
                                                          java.lang.String acceptType,
                                                          org.apache.http.client.HttpClient httpClient,
                                                          org.apache.http.protocol.HttpContext httpContext)
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        java.lang.String contentType,
                                        java.lang.String content,
                                        java.lang.String acceptType,
                                        HttpResponseHandler handler,
                                        org.apache.http.client.HttpClient httpClient,
                                        org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP POST with a string as the request body and response handling
        Parameters:
        url - URL
        contentType - Content Type to POST
        content - Content to POST
        acceptType - Accept Type
        handler - Response handler called to process the response
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        java.lang.String contentType,
                                        java.io.InputStream input,
                                        long length)
        Executes a HTTP POST with a request body from an input stream without response body with no response handling
        Parameters:
        url - URL
        contentType - Content Type to POST
        input - Input Stream to POST from
        length - Amount of content to POST
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        java.lang.String contentType,
                                        java.io.InputStream input,
                                        long length,
                                        java.lang.String acceptType,
                                        HttpResponseHandler handler)
        Executes a HTTP POST with request body from an input stream and response handling.

        The input stream is assumed to be UTF-8.

        Parameters:
        url - URL
        contentType - Content Type to POST
        input - Input Stream to POST content from
        length - Length of content to POST
        acceptType - Accept Type
        handler - Response handler called to process the response
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        java.lang.String contentType,
                                        java.io.InputStream input,
                                        long length,
                                        java.lang.String acceptType,
                                        HttpResponseHandler handler,
                                        org.apache.http.client.HttpClient httpClient,
                                        org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP POST with request body from an input stream and response handling.

        The input stream is assumed to be UTF-8.

        Parameters:
        url - URL
        contentType - Content Type to POST
        input - Input Stream to POST content from
        length - Length of content to POST
        acceptType - Accept Type
        handler - Response handler called to process the response
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        org.apache.http.HttpEntity entity)
        Executes a HTTP POST of the given entity
        Parameters:
        url - URL
        entity - Entity to POST
      • execHttpPostStream

        public static TypedInputStream execHttpPostStream​(java.lang.String url,
                                                          org.apache.http.HttpEntity entity,
                                                          java.lang.String acceptHeader)
        Execute a HTTP POST and return the typed return stream.
        Parameters:
        url - URL
        entity - Entity to POST
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        org.apache.http.HttpEntity entity,
                                        java.lang.String acceptString,
                                        HttpResponseHandler handler)
        Executes a HTTP Post
        Parameters:
        url - URL
        entity - Entity to POST
        acceptString - Accept Header
        handler - Response Handler
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        org.apache.http.HttpEntity entity,
                                        org.apache.http.client.HttpClient httpClient,
                                        org.apache.http.protocol.HttpContext httpContext)
        POST with response body.

        The content for the POST body comes from the HttpEntity.

        Additional headers e.g. for authentication can be injected through an HttpContext

        Parameters:
        url - URL
        entity - Entity to POST
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPostStream

        public static TypedInputStream execHttpPostStream​(java.lang.String url,
                                                          org.apache.http.HttpEntity entity,
                                                          java.lang.String acceptHeader,
                                                          org.apache.http.client.HttpClient httpClient,
                                                          org.apache.http.protocol.HttpContext httpContext)
        POST with response body.

        The content for the POST body comes from the HttpEntity.

        Additional headers e.g. for authentication can be injected through an HttpContext

        Parameters:
        url - URL
        entity - Entity to POST
        acceptHeader - Accept Header
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPost

        public static void execHttpPost​(java.lang.String url,
                                        org.apache.http.HttpEntity entity,
                                        java.lang.String acceptHeader,
                                        HttpResponseHandler handler,
                                        org.apache.http.client.HttpClient httpClient,
                                        org.apache.http.protocol.HttpContext httpContext)
        POST with response body.

        The content for the POST body comes from the HttpEntity.

        Additional headers e.g. for authentication can be injected through an HttpContext

        Parameters:
        url - URL
        entity - Entity to POST
        acceptHeader - Accept Header
        handler - Response handler called to process the response
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPostForm

        public static void execHttpPostForm​(java.lang.String url,
                                            Params params)
        Executes a HTTP POST.
        Parameters:
        url - URL
        params - Parameters to POST
      • execHttpPostFormStream

        public static TypedInputStream execHttpPostFormStream​(java.lang.String url,
                                                              Params params,
                                                              java.lang.String acceptHeader)
        Executes a HTTP POST and returns a TypedInputStream, The TypedInputStream must be closed.
        Parameters:
        url - URL
        params - Parameters to POST
        acceptHeader -
      • execHttpPostFormStream

        public static TypedInputStream execHttpPostFormStream​(java.lang.String url,
                                                              Params params,
                                                              java.lang.String acceptHeader,
                                                              org.apache.http.client.HttpClient httpClient,
                                                              org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP POST Form and returns a TypedInputStream

        The acceptHeader string is any legal value for HTTP Accept: field.

        A 404 will result in a null stream being returned, any other error code results in an exception.

        Parameters:
        url - URL
        acceptHeader - Accept Header
        params - Parameters to POST
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPostForm

        public static void execHttpPostForm​(java.lang.String url,
                                            Params params,
                                            java.lang.String acceptString,
                                            HttpResponseHandler handler)
        Executes a HTTP POST form operation
        Parameters:
        url - URL
        params - Form parameters to POST
        acceptString - Accept Header
        handler - Response handler called to process the response
      • execHttpPostForm

        public static void execHttpPostForm​(java.lang.String url,
                                            Params params,
                                            java.lang.String acceptHeader,
                                            HttpResponseHandler handler,
                                            org.apache.http.client.HttpClient httpClient,
                                            org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP POST form operation
        Parameters:
        url - URL
        params - Form parameters to POST
        acceptHeader - Accept Header
        handler - Response handler called to process the response
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPut

        public static void execHttpPut​(java.lang.String url,
                                       java.lang.String contentType,
                                       java.lang.String content)
        Executes a HTTP PUT operation
        Parameters:
        url - URL
        contentType - Content Type for the PUT
        content - Content for the PUT
      • execHttpPut

        public static void execHttpPut​(java.lang.String url,
                                       java.lang.String contentType,
                                       java.lang.String content,
                                       org.apache.http.client.HttpClient httpClient,
                                       org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP PUT operation
        Parameters:
        url - URL
        contentType - Content Type for the PUT
        content - Content for the PUT
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPut

        public static void execHttpPut​(java.lang.String url,
                                       java.lang.String contentType,
                                       java.io.InputStream input,
                                       long length)
        Executes a HTTP PUT operation
        Parameters:
        url - URL
        contentType - Content Type for the PUT
        input - Input Stream to read PUT content from
        length - Amount of content to PUT
      • execHttpPut

        public static void execHttpPut​(java.lang.String url,
                                       java.lang.String contentType,
                                       java.io.InputStream input,
                                       long length,
                                       org.apache.http.client.HttpClient httpClient,
                                       org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP PUT operation
        Parameters:
        url - URL
        contentType - Content Type for the PUT
        input - Input Stream to read PUT content from
        length - Amount of content to PUT
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpPut

        public static void execHttpPut​(java.lang.String url,
                                       org.apache.http.HttpEntity entity)
        Executes a HTTP PUT operation
        Parameters:
        url - URL
        entity - HTTP Entity to PUT
      • execHttpPut

        public static void execHttpPut​(java.lang.String url,
                                       org.apache.http.HttpEntity entity,
                                       org.apache.http.client.HttpClient httpClient,
                                       org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP PUT operation
        Parameters:
        url - URL
        entity - HTTP Entity to PUT
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpHead

        public static void execHttpHead​(java.lang.String url)
        Executes a HTTP HEAD operation
        Parameters:
        url - URL
      • execHttpHead

        public static void execHttpHead​(java.lang.String url,
                                        java.lang.String acceptString,
                                        HttpResponseHandler handler)
        Executes a HTTP HEAD operation
        Parameters:
        url - URL
        acceptString - Accept Header
        handler - Response Handler
      • execHttpHead

        public static void execHttpHead​(java.lang.String url,
                                        java.lang.String acceptString,
                                        HttpResponseHandler handler,
                                        org.apache.http.client.HttpClient httpClient,
                                        org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP HEAD operation
        Parameters:
        url - URL
        acceptString - Accept Header
        handler - Response Handler
        httpClient - HTTP Client
        httpContext - HTTP Context
      • execHttpDelete

        public static void execHttpDelete​(java.lang.String url)
        Executes a HTTP DELETE operation
        Parameters:
        url - URL
      • execHttpDelete

        public static void execHttpDelete​(java.lang.String url,
                                          HttpResponseHandler handler)
        Executes a HTTP DELETE operation
        Parameters:
        url - URL
        handler - Response Handler
      • execHttpDelete

        public static void execHttpDelete​(java.lang.String url,
                                          HttpResponseHandler handler,
                                          org.apache.http.client.HttpClient httpClient,
                                          org.apache.http.protocol.HttpContext httpContext)
        Executes a HTTP DELETE operation
        Parameters:
        url - URL
        handler - Response Handler
        httpClient - HTTP Client
        httpContext - HTTP Context
      • readPayload

        public static java.lang.String readPayload​(org.apache.http.HttpEntity entity)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • applyUserAgent

        public static void applyUserAgent​(org.apache.http.HttpMessage message)
        Applies the configured User-Agent string to the HTTP request
        Parameters:
        message - HTTP request