Interface HttpMessage

    • Method Detail

      • setVersion

        void setVersion​(ProtocolVersion version)
        Sets protocol version.

        For incoming messages it represents protocol version this message was transmitted with. For outgoing messages it represents a hint what protocol version should be used to transmit the message.

        Since:
        5.0
      • getVersion

        ProtocolVersion getVersion()
        Returns protocol version or null when not available.

        For incoming messages it represents protocol version this message was transmitted with. For outgoing messages it represents a hint what protocol version should be used to transmit the message.

        Since:
        5.0
      • addHeader

        void addHeader​(Header header)
        Adds a header to this message. The header will be appended to the end of the list.
        Parameters:
        header - the header to append.
      • addHeader

        void addHeader​(java.lang.String name,
                       java.lang.Object value)
        Adds a header to this message. The header will be appended to the end of the list.
        Parameters:
        name - the name of the header.
        value - the value of the header, taken as the value's Object.toString().
      • setHeader

        void setHeader​(Header header)
        Overwrites the first header with the same name. The new header will be appended to the end of the list, if no header with the given name can be found.
        Parameters:
        header - the header to set.
      • setHeader

        void setHeader​(java.lang.String name,
                       java.lang.Object value)
        Overwrites the first header with the same name. The new header will be appended to the end of the list, if no header with the given name can be found.
        Parameters:
        name - the name of the header.
        value - the value of the header, taken as the value's Object.toString().
      • setHeaders

        void setHeaders​(Header... headers)
        Overwrites all the headers in the message.
        Parameters:
        headers - the array of headers to set.
      • removeHeader

        boolean removeHeader​(Header header)
        Removes a header from this message.
        Parameters:
        header - the header to remove.
        Returns:
        true if a header was removed as a result of this call.
      • removeHeaders

        boolean removeHeaders​(java.lang.String name)
        Removes all headers with a certain name from this message.
        Parameters:
        name - The name of the headers to remove.
        Returns:
        true if any header was removed as a result of this call.