Interface HttpMessage

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void addHeader​(java.lang.String name, java.lang.String value)
      Adds a header to this message.
      void addHeader​(Header header)
      Adds a header to this message.
      boolean containsHeader​(java.lang.String name)
      Checks if a certain header is present in this message.
      Header[] getAllHeaders()
      Returns all the headers of this message.
      Header getFirstHeader​(java.lang.String name)
      Returns the first header with a specified name of this message.
      Header[] getHeaders​(java.lang.String name)
      Returns all the headers with a specified name of this message.
      Header getLastHeader​(java.lang.String name)
      Returns the last header with a specified name of this message.
      HttpParams getParams()
      Deprecated.
      (4.3) use configuration classes provided 'org.apache.http.config' and 'org.apache.http.client.config'
      ProtocolVersion getProtocolVersion()
      Returns the protocol version this message is compatible with.
      HeaderIterator headerIterator()
      Returns an iterator of all the headers.
      HeaderIterator headerIterator​(java.lang.String name)
      Returns an iterator of the headers with a given name.
      void removeHeader​(Header header)
      Removes a header from this message.
      void removeHeaders​(java.lang.String name)
      Removes all headers with a certain name from this message.
      void setHeader​(java.lang.String name, java.lang.String value)
      Overwrites the first header with the same name.
      void setHeader​(Header header)
      Overwrites the first header with the same name.
      void setHeaders​(Header[] headers)
      Overwrites all the headers in the message.
      void setParams​(HttpParams params)
      Deprecated.
      (4.3) use configuration classes provided 'org.apache.http.config' and 'org.apache.http.client.config'
    • Method Detail

      • getProtocolVersion

        ProtocolVersion getProtocolVersion()
        Returns the protocol version this message is compatible with.
      • containsHeader

        boolean containsHeader​(java.lang.String name)
        Checks if a certain header is present in this message. Header values are ignored.
        Parameters:
        name - the header name to check for.
        Returns:
        true if at least one header with this name is present.
      • getHeaders

        Header[] getHeaders​(java.lang.String name)
        Returns all the headers with a specified name of this message. Header values are ignored. Headers are orderd in the sequence they will be sent over a connection.
        Parameters:
        name - the name of the headers to return.
        Returns:
        the headers whose name property equals name.
      • getFirstHeader

        Header getFirstHeader​(java.lang.String name)
        Returns the first header with a specified name of this message. Header values are ignored. If there is more than one matching header in the message the first element of getHeaders(String) is returned. If there is no matching header in the message null is returned.
        Parameters:
        name - the name of the header to return.
        Returns:
        the first header whose name property equals name or null if no such header could be found.
      • getLastHeader

        Header getLastHeader​(java.lang.String name)
        Returns the last header with a specified name of this message. Header values are ignored. If there is more than one matching header in the message the last element of getHeaders(String) is returned. If there is no matching header in the message null is returned.
        Parameters:
        name - the name of the header to return.
        Returns:
        the last header whose name property equals name. or null if no such header could be found.
      • getAllHeaders

        Header[] getAllHeaders()
        Returns all the headers of this message. Headers are orderd in the sequence they will be sent over a connection.
        Returns:
        all the headers of this message
      • 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.String 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.
      • 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.String 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.
      • setHeaders

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

        void removeHeader​(Header header)
        Removes a header from this message.
        Parameters:
        header - the header to remove.
      • removeHeaders

        void removeHeaders​(java.lang.String name)
        Removes all headers with a certain name from this message.
        Parameters:
        name - The name of the headers to remove.
      • headerIterator

        HeaderIterator headerIterator()
        Returns an iterator of all the headers.
        Returns:
        Iterator that returns Header objects in the sequence they are sent over a connection.
      • headerIterator

        HeaderIterator headerIterator​(java.lang.String name)
        Returns an iterator of the headers with a given name.
        Parameters:
        name - the name of the headers over which to iterate, or null for all headers
        Returns:
        Iterator that returns Header objects with the argument name in the sequence they are sent over a connection.
      • getParams

        @Deprecated
        HttpParams getParams()
        Deprecated.
        (4.3) use configuration classes provided 'org.apache.http.config' and 'org.apache.http.client.config'
        Returns the parameters effective for this message as set by setParams(HttpParams).
      • setParams

        @Deprecated
        void setParams​(HttpParams params)
        Deprecated.
        (4.3) use configuration classes provided 'org.apache.http.config' and 'org.apache.http.client.config'
        Provides parameters to be used for the processing of this message.
        Parameters:
        params - the parameters