FileDocCategorySizeDatePackage
HttpMessage.javaAPI DocAndroid 1.5 API6407Wed May 06 22:41:10 BST 2009org.apache.http

HttpMessage

public interface HttpMessage
A generic HTTP message. Holds what is common between requests and responses.
author
Oleg Kalnichevski
version
$Revision: 610823 $
since
4.0

Fields Summary
Constructors Summary
Methods Summary
public voidaddHeader(org.apache.http.Header header)
Adds a header to this message. The header will be appended to the end of the list.

param
header the header to append.

public voidaddHeader(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.

param
name the name of the header.
param
value the value of the header.

public booleancontainsHeader(java.lang.String name)
Checks if a certain header is present in this message. Header values are ignored.

param
name the header name to check for.
return
true if at least one header with this name is present.

public org.apache.http.Header[]getAllHeaders()
Returns all the headers of this message. Headers are orderd in the sequence they will be sent over a connection.

return
all the headers of this message

public org.apache.http.HeadergetFirstHeader(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 {@link #getHeaders(String)} is returned. If there is no matching header in the message null is returned.

param
name the name of the header to return.
return
the first header whose name property equals name or null if no such header could be found.

public org.apache.http.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.

param
name the name of the headers to return.
return
the headers whose name property equals name.

public org.apache.http.HeadergetLastHeader(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 {@link #getHeaders(String)} is returned. If there is no matching header in the message null is returned.

param
name the name of the header to return.
return
the last header whose name property equals name. or null if no such header could be found.

public org.apache.http.params.HttpParamsgetParams()
Returns the parameters effective for this message as set by {@link #setParams(HttpParams)}.

public org.apache.http.ProtocolVersiongetProtocolVersion()
Returns the protocol version this message is compatible with.

public org.apache.http.HeaderIteratorheaderIterator()
Returns an iterator of all the headers.

return
Iterator that returns Header objects in the sequence they are sent over a connection.

public org.apache.http.HeaderIteratorheaderIterator(java.lang.String name)
Returns an iterator of the headers with a given name.

param
name the name of the headers over which to iterate, or null for all headers
return
Iterator that returns Header objects with the argument name in the sequence they are sent over a connection.

public voidremoveHeader(org.apache.http.Header header)
Removes a header from this message.

param
header the header to remove.

public voidremoveHeaders(java.lang.String name)
Removes all headers with a certain name from this message.

param
name The name of the headers to remove.

public voidsetHeader(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.

param
name the name of the header.
param
value the value of the header.

public voidsetHeader(org.apache.http.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.

param
header the header to set.

public voidsetHeaders(org.apache.http.Header[] headers)
Overwrites all the headers in the message.

param
headers the array of headers to set.

public voidsetParams(org.apache.http.params.HttpParams params)
Provides parameters to be used for the processing of this message.

param
params the parameters