Class NettyResponse

    • Method Detail

      • getStatusCode

        public final int getStatusCode()
        Description copied from interface: Response
        Returns the status code for the request.
        Specified by:
        getStatusCode in interface Response
        Returns:
        The status code
      • getStatusText

        public final String getStatusText()
        Description copied from interface: Response
        Returns the status text for the request.
        Specified by:
        getStatusText in interface Response
        Returns:
        The status text
      • getUri

        public final Uri getUri()
        Description copied from interface: Response
        Return the request Uri. Note that if the request got redirected, the value of the Uri will be the last valid redirect url.
        Specified by:
        getUri in interface Response
        Returns:
        the request Uri.
      • getRemoteAddress

        public SocketAddress getRemoteAddress()
        Description copied from interface: Response
        Get the remote address that the client initiated the request to.
        Specified by:
        getRemoteAddress in interface Response
        Returns:
        The remote address that the client initiated the request to. May be null if asynchronous provider is unable to provide the remote address
      • getLocalAddress

        public SocketAddress getLocalAddress()
        Description copied from interface: Response
        Get the local address that the client initiated the request from.
        Specified by:
        getLocalAddress in interface Response
        Returns:
        The local address that the client initiated the request from. May be null if asynchronous provider is unable to provide the local address
      • getContentType

        public final String getContentType()
        Description copied from interface: Response
        Return the content-type header value.
        Specified by:
        getContentType in interface Response
        Returns:
        the content-type header value.
      • getHeader

        public final String getHeader​(CharSequence name)
        Specified by:
        getHeader in interface Response
        Parameters:
        name - the header name
        Returns:
        the first response header value
      • getHeaders

        public final List<String> getHeaders​(CharSequence name)
        Description copied from interface: Response
        Return a List of the response header value.
        Specified by:
        getHeaders in interface Response
        Parameters:
        name - the header name
        Returns:
        the response header value
      • getHeaders

        public final io.netty.handler.codec.http.HttpHeaders getHeaders()
        Specified by:
        getHeaders in interface Response
      • isRedirected

        public final boolean isRedirected()
        Description copied from interface: Response
        Return true if the response redirects to another object.
        Specified by:
        isRedirected in interface Response
        Returns:
        True if the response redirects to another object.
      • getCookies

        public List<io.netty.handler.codec.http.cookie.Cookie> getCookies()
        Specified by:
        getCookies in interface Response
        Returns:
        the list of Cookie.
      • hasResponseStatus

        public boolean hasResponseStatus()
        Description copied from interface: Response
        Return true if the response's status has been computed by an AsyncHandler
        Specified by:
        hasResponseStatus in interface Response
        Returns:
        true if the response's status has been computed by an AsyncHandler
      • getResponseBodyAsBytes

        public byte[] getResponseBodyAsBytes()
        Description copied from interface: Response
        Return the entire response body as a byte[].
        Specified by:
        getResponseBodyAsBytes in interface Response
        Returns:
        the entire response body as a byte[].
      • getResponseBodyAsByteBuffer

        public ByteBuffer getResponseBodyAsByteBuffer()
        Description copied from interface: Response
        Return the entire response body as a ByteBuffer.
        Specified by:
        getResponseBodyAsByteBuffer in interface Response
        Returns:
        the entire response body as a ByteBuffer.
      • getResponseBody

        public String getResponseBody()
        Description copied from interface: Response
        Return the entire response body as a String.
        Specified by:
        getResponseBody in interface Response
        Returns:
        the entire response body as a String.
      • getResponseBody

        public String getResponseBody​(Charset charset)
        Description copied from interface: Response
        Return the entire response body as a String.
        Specified by:
        getResponseBody in interface Response
        Parameters:
        charset - the charset to use when decoding the stream
        Returns:
        the entire response body as a String.
      • getResponseBodyAsStream

        public InputStream getResponseBodyAsStream()
        Description copied from interface: Response
        Returns an input stream for the response body. Note that you should not try to get this more than once, and that you should not close the stream.
        Specified by:
        getResponseBodyAsStream in interface Response
        Returns:
        The input stream
      • toString

        public String toString()
        Description copied from interface: Response
        Subclasses SHOULD implement toString() in a way that identifies the response for logging.
        Specified by:
        toString in interface Response
        Overrides:
        toString in class Object
        Returns:
        the textual representation