Class HttpResponse


  • public class HttpResponse
    extends java.lang.Object
    • Field Detail

      • HTTP_TARGET_HOST

        public static final java.lang.String HTTP_TARGET_HOST
        See Also:
        Constant Field Values
    • Constructor Detail

      • HttpResponse

        public HttpResponse()
    • Method Detail

      • isSuccessful

        public boolean isSuccessful()
      • getStatus

        public int getStatus()
      • setTargetHost

        public HttpResponse setTargetHost​(java.lang.String host)
        Sets the host this response was received from.
        Parameters:
        host - originating host
      • getTargetHost

        public java.lang.String getTargetHost()
        Returns the host this response was received from, or null if it was not set.
        Returns:
        originating host
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String key)
        Retrieves a user-defined attribute of this message. Attributes are stored as simple key-value pairs and are not included in a message's serialized form.
        Parameters:
        key - attribute name
        Returns:
        attribute object
      • setAttribute

        public M setAttribute​(java.lang.String key,
                              java.lang.Object value)
      • removeAttribute

        public M removeAttribute​(java.lang.String key)
      • getAttributeNames

        public java.lang.Iterable<java.lang.String> getAttributeNames()
      • getHeaderNames

        public java.lang.Iterable<java.lang.String> getHeaderNames()
      • getHeaders

        public java.lang.Iterable<java.lang.String> getHeaders​(java.lang.String name)
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
      • setHeader

        public M setHeader​(java.lang.String name,
                           java.lang.String value)
      • addHeader

        public M addHeader​(java.lang.String name,
                           java.lang.String value)
      • removeHeader

        public M removeHeader​(java.lang.String name)
      • getContentEncoding

        public java.nio.charset.Charset getContentEncoding()
      • setContent

        @Deprecated
        public void setContent​(java.io.InputStream toStreamFrom)
        Deprecated.
        Pass () -> toStreamFrom to setContent(Supplier).
      • setContent

        public M setContent​(java.util.function.Supplier<java.io.InputStream> supplier)
      • getContent

        public java.util.function.Supplier<java.io.InputStream> getContent()
      • getContentStream

        @Deprecated
        public java.io.InputStream getContentStream()
        Deprecated.
        Use getContent() and call Supplier.get().
      • consumeContentStream

        @Deprecated
        public java.io.InputStream consumeContentStream()
        Deprecated.
        No direct replacement. Use getContent() and call Supplier.get().
        Get the underlying content stream, bypassing the caching mechanisms that allow it to be read again.