Class HttpResponseImpl

    • Method Detail

      • wrap

        public static HttpResponseImpl wrap​(org.apache.http.client.methods.CloseableHttpResponse response)
        Wrap the given Response
        Parameters:
        response - the response
        Returns:
        the HttpResponse
      • unwrap

        public org.apache.http.client.methods.CloseableHttpResponse unwrap()
        Unwrap and return the original Response
        Returns:
        the response
      • getEntity

        public <T> T getEntity​(Class<T> returnType)
        Gets the entity and Maps any errors which will result in a ResponseException
        Specified by:
        getEntity in interface HttpResponse
        Type Parameters:
        T - the generic type
        Parameters:
        returnType - the return type
        Returns:
        the entity
      • getEntity

        public <T> T getEntity​(Class<T> returnType,
                               ExecutionOptions<T> options)
        Gets the entity and Maps any errors which will result in a ResponseException
        Specified by:
        getEntity in interface HttpResponse
        Type Parameters:
        T - the generic type
        Parameters:
        returnType - the return type
        options - execution options
        Returns:
        the entity
      • getStatus

        public int getStatus()
        Gets the status from the previous Request
        Specified by:
        getStatus in interface HttpResponse
        Returns:
        the status code
      • header

        public String header​(String name)
        Returns a Header value from the specified name key
        Specified by:
        header in interface HttpResponse
        Parameters:
        name - the name of the header to query for
        Returns:
        the header as a String or null if not found