Interface IHTTPResponse


  • public interface IHTTPResponse
    • Field Detail

      • UPGRADE_PROTOCOL_WEBSOCKETS

        static final int UPGRADE_PROTOCOL_WEBSOCKETS
        See Also:
        Constant Field Values
    • Method Detail

      • getOutputStream

        java.io.OutputStream getOutputStream()
        Get the output stream for the response. You can then write directly into the output stream.
        Returns:
        output stream for the response
      • containsHeader

        boolean containsHeader​(String name)
        Returns true if response header contains parameter name
        Parameters:
        name - header parameter name
        Returns:
        true if header contains value
      • setHeader

        void setHeader​(String name,
                       String value)
        Set header value
        Parameters:
        name - header parameter name
        value - parameter value
      • removeHeader

        void removeHeader​(String name)
        Remove header value
        Parameters:
        name - name
      • setIntHeader

        void setIntHeader​(String name,
                          int value)
        Set header value as int
        Parameters:
        name - header parameter name
        value - parameter value
      • getHeaders

        java.util.Map getHeaders()
        Get the current response headers as a map
        Returns:
        current response headers as a map
      • getHeader

        String getHeader​(String name)
        Get header value
        Parameters:
        name - header parameter name
        Returns:
        parameter value
      • getIntHeader

        int getIntHeader​(String name)
        Get header value as int
        Parameters:
        name - header parameter name
        Returns:
        parameter value
      • setResponseCode

        void setResponseCode​(int responseCode)
        Set the HTTP response code
        Parameters:
        responseCode - HTTP response code
      • getHeaderSize

        int getHeaderSize()
        Get the size in bytes of the HTTP header
        Returns:
        header size in bytes
      • setHeadResponse

        void setHeadResponse​(boolean isHeadResponse)
        indicates if the response is a response to a HEAD request
        Parameters:
        isHeadResponse - indicating if this is a response to a HEAD request
      • isHeadResponse

        boolean isHeadResponse()
        returns true if the response is due to a HEAD request
        Returns:
        true if the response is due to a HEAD request
      • getUpgradeRequestProtocol

        int getUpgradeRequestProtocol()
        Get the upgrade request protocol, -1 means no upgrade, see UPGRADE_PROTOCOL_*
        Returns:
        upgrade request protocol
      • setUpgradeRequestProtocol

        void setUpgradeRequestProtocol​(int upgradeRequestProtocol,
                                       IWebSocketEventNotify listener)
        Set the upgrade request protocol, -1 means no upgrade, see UPGRADE_PROTOCOL_*
        Parameters:
        upgradeRequestProtocol - upgrade request protocol
        listener - event listener
      • setIsCte

        void setIsCte​(boolean b)
      • addHtmlHeaders

        default void addHtmlHeaders​(String path)