Interface MutableHeaders

  • All Superinterfaces:
    Headers

    public interface MutableHeaders
    extends Headers
    A set of HTTP headers that can be changed.
    • Method Detail

      • add

        MutableHeaders add​(CharSequence name,
                           Object value)
        Adds a new header with the specified name and value.

        Will not replace any existing values for the header.

        Objects of type Instant, Calendar or Date will be converted to a RFC 7231 date/time string.

        Parameters:
        name - The name of the header
        value - The value of the header
        Returns:
        this
      • set

        MutableHeaders set​(CharSequence name,
                           Object value)
        Sets the (only) value for the header with the specified name.

        All existing values for the same header will be removed.

        Objects of type Instant, Calendar or Date will be converted to a RFC 7231 date/time string.

        Parameters:
        name - The name of the header
        value - The value of the header
        Returns:
        this
      • setDate

        MutableHeaders setDate​(CharSequence name,
                               Date value)
        Set a header with the given date as the value.
        Parameters:
        name - The name of the header
        value - The date value
        Returns:
        this
      • setDate

        default MutableHeaders setDate​(CharSequence name,
                                       Instant value)
        Set a header with the given date as the value.
        Parameters:
        name - the name of the header
        value - the date value
        Returns:
        this
        Since:
        1.4
      • set

        MutableHeaders set​(CharSequence name,
                           Iterable<?> values)
        Sets a new header with the specified name and values.

        All existing values for the same header will be removed.

        Objects of type Instant, Calendar or Date will be converted to a RFC 7231 date/time string.

        Parameters:
        name - The name of the header
        values - The values of the header
        Returns:
        this
      • remove

        MutableHeaders remove​(CharSequence name)
        Removes the header with the specified name.
        Parameters:
        name - The name of the header to remove.
        Returns:
        this
      • clear

        MutableHeaders clear()
        Removes all headers from this message.
        Returns:
        this