Package com.dnanexus

Class DXHTTPRequest


  • public class DXHTTPRequest
    extends Object
    Class for making a raw DNAnexus API call via HTTP.
    • Field Detail

      • httpclient

        protected final org.apache.http.client.HttpClient httpclient
    • Constructor Detail

      • DXHTTPRequest

        public DXHTTPRequest()
        Construct the DXHTTPRequest using the default DXEnvironment.
      • DXHTTPRequest

        public DXHTTPRequest​(DXEnvironment env)
        Construct the DXHTTPRequest using the given DXEnvironment.
    • Method Detail

      • getHttpClient

        protected org.apache.http.client.HttpClient getHttpClient()
        Allows custom DXHTTPRequest to setup overridden httpClient
      • getHttpContext

        protected org.apache.http.protocol.HttpContext getHttpContext()
        Allows custom HttpContext to setup overridden http. parameters e.g. http.conn-manager.timeout for PoolingHttpClientConnectionManager
      • request

        @Deprecated
        public com.fasterxml.jackson.databind.JsonNode request​(String resource,
                                                               com.fasterxml.jackson.databind.JsonNode data)
        Issues a request against the specified resource (assuming requests ARE safe to be retried) and returns the result as a JSON object.
        Parameters:
        resource - Name of resource, e.g. "/file-XXXX/describe"
        data - Request payload (to be converted to JSON)
        Throws:
        DXAPIException - If the server returns a complete response with an HTTP status code other than 200 (OK).
        DXHTTPException - If an error occurs while making the HTTP request or obtaining the response (includes HTTP protocol errors).
      • request

        public com.fasterxml.jackson.databind.JsonNode request​(String resource,
                                                               com.fasterxml.jackson.databind.JsonNode data,
                                                               DXHTTPRequest.RetryStrategy retryStrategy)
        Issues a request against the specified resource and returns the result as a JSON object.
        Parameters:
        resource - Name of resource, e.g. "/file-XXXX/describe"
        data - Request payload (to be converted to JSON)
        retryStrategy - Indicates whether the request is idempotent and can be retried
        Throws:
        DXAPIException - If the server returns a complete response with an HTTP status code other than 200 (OK).
        DXHTTPException - If an error occurs while making the HTTP request or obtaining the response (includes HTTP protocol errors).
      • request

        @Deprecated
        public String request​(String resource,
                              String data)
        Deprecated.
        Issues a request against the specified resource (assuming requests ARE safe to be retried) and returns the result as a String.
        Parameters:
        resource - Name of resource, e.g. "/file-XXXX/describe"
        data - Request payload (String to be sent verbatim)
        Throws:
        DXAPIException - If the server returns a complete response with an HTTP status code other than 200 (OK).
        DXHTTPException - If an error occurs while making the HTTP request or obtaining the response (includes HTTP protocol errors).
      • request

        public String request​(String resource,
                              String data,
                              DXHTTPRequest.RetryStrategy retryStrategy)
        Issues a request against the specified resource and returns the result as a String.
        Parameters:
        resource - Name of resource, e.g. "/file-XXXX/describe"
        data - Request payload (String to be sent verbatim)
        retryStrategy - Indicates whether the request is idempotent and can be retried
        Throws:
        DXAPIException - If the server returns a complete response with an HTTP status code other than 200 (OK).
        DXHTTPException - If an error occurs while making the HTTP request or obtaining the response (includes HTTP protocol errors).