Interface RawResponse

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Config getConfig()
      Returns the current config for this request/response
      java.io.InputStream getContent()
      Returns the body content of the response as a InputStream.
      byte[] getContentAsBytes()
      Returns the body as bytes.
      java.lang.String getContentAsString()
      Returns the body as UTF-8 String.
      java.lang.String getContentAsString​(java.lang.String charset)
      Returns the body as UTF-8 String.
      java.io.InputStreamReader getContentReader()
      Returns the body content of the response as a InputStreamReader.
      java.lang.String getContentType()
      Returns the mime type of the response content as indicated by the Content-Type header or a empty string if none is supplied (e.g.
      java.lang.String getEncoding()
      Returns the encoding of the response as indicated by the Content-Encoding header or returns a empty string if none provided.
      Headers getHeaders()
      Returns the received response headers.
      HttpRequestSummary getRequestSummary()
      returns a lightweight read only summary of the request.
      int getStatus()
      Returns the status code for this response.
      java.lang.String getStatusText()
      Returns the status text for this response.
      boolean hasContent()
      Indicates that the response has content
      HttpResponseSummary toSummary()
      returns a lightweight read only summary of the response.
    • Method Detail

      • getStatus

        int getStatus()
        Returns the status code for this response.
        Returns:
        the response code
      • getStatusText

        java.lang.String getStatusText()
        Returns the status text for this response.
        Returns:
        the response text
      • getHeaders

        Headers getHeaders()
        Returns the received response headers.
        Returns:
        the response headers
      • getContent

        java.io.InputStream getContent()
        Returns the body content of the response as a InputStream. Like most InputStreams it can only be read once. If you read the response though some other method like getContentAsBytes() or getBodyAsString() it will read this method and consume the InputStream
        Returns:
        the content
      • getContentAsBytes

        byte[] getContentAsBytes()
        Returns the body as bytes. This consumes the entire InputStream. Warning: Calling this on very large responses will place all data in memory and could create OutOfMemory errors
        Returns:
        the content as bytes
      • getContentAsString

        java.lang.String getContentAsString()
        Returns the body as UTF-8 String. This consumes the entire InputStream. Warning: Calling this on very large responses will place all data in memory and could create OutOfMemory errors Using this method with a binary response will make you sad
        Returns:
        the content as a UTF-8 String
      • getContentAsString

        java.lang.String getContentAsString​(java.lang.String charset)
        Returns the body as UTF-8 String. This consumes the entire InputStream. Warning: Calling this on very large responses will place all data in memory and could create OutOfMemory errors Using this method with a binary response will make you sad
        Parameters:
        charset - the charset for the String
        Returns:
        the content as a string in the provided charset.
      • getContentReader

        java.io.InputStreamReader getContentReader()
        Returns the body content of the response as a InputStreamReader. Like most InputStreams it can only be read once. If you read the response though some other method like getContentAsBytes() or getBodyAsString() it will read this method and consume the InputStream
        Returns:
        the content
      • hasContent

        boolean hasContent()
        Indicates that the response has content
        Returns:
        boolean indicating that the response has content.
      • getContentType

        java.lang.String getContentType()
        Returns the mime type of the response content as indicated by the Content-Type header or a empty string if none is supplied (e.g. application/json)
        Returns:
        the Content-Type
      • getEncoding

        java.lang.String getEncoding()
        Returns the encoding of the response as indicated by the Content-Encoding header or returns a empty string if none provided.
        Returns:
        the encoding
      • getConfig

        Config getConfig()
        Returns the current config for this request/response
        Returns:
        the config
      • getRequestSummary

        HttpRequestSummary getRequestSummary()
        returns a lightweight read only summary of the request.
        Returns:
        the request summary
      • toSummary

        HttpResponseSummary toSummary()
        returns a lightweight read only summary of the response.
        Returns:
        the response summary