Top Description Fields Constructors Methods
org.apache.http.message

public abstract Class AbstractHttpMessage

extends Object
implements HttpMessage
Class Inheritance
All Implemented Interfaces
org.apache.http.HttpMessage
Known Direct Subclasses
org.apache.http.message.BasicHttpRequest, org.apache.http.message.BasicHttpResponse
Annotations
@SuppressWarnings:deprecation
Imports
org.apache.http.Header, .HeaderIterator, .HttpMessage, org.apache.http.params.BasicHttpParams, .HttpParams, org.apache.http.util.Args

Basic implementation of HttpMessage.
Since
4.0

Field Summary

Modifier and TypeField and Description
protected HeaderGroup
protected HttpParams
params

Deprecated Do not use.

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public void
addHeader(final Header
the header to append.
header
)

Implements org.apache.http.HttpMessage.addHeader.

Adds a header to this message.
public void
addHeader(final String
the name of the header.
name
,
final String
the value of the header.
value
)

Implements org.apache.http.HttpMessage.addHeader.

Adds a header to this message.
public boolean
containsHeader(final String
the header name to check for.
name
)

Implements org.apache.http.HttpMessage.containsHeader.

Checks if a certain header is present in this message.
public Header[]
getAllHeaders()

Implements org.apache.http.HttpMessage.getAllHeaders.

Returns all the headers of this message.
public Header
getFirstHeader(final String
the name of the header to return.
name
)

Implements org.apache.http.HttpMessage.getFirstHeader.

Returns the first header with a specified name of this message.
public Header[]
getHeaders(final String
the name of the headers to return.
name
)

Implements org.apache.http.HttpMessage.getHeaders.

Returns all the headers with a specified name of this message.
public Header
getLastHeader(final String
the name of the header to return.
name
)

Implements org.apache.http.HttpMessage.getLastHeader.

Returns the last header with a specified name of this message.
public HttpParams
getParams()

Implements org.apache.http.HttpMessage.getParams.

Deprecated (4.3) use constructor parameters of configuration API provided by HttpClient
Returns the parameters effective for this message as set by setParams(HttpParams).
public HeaderIterator
headerIterator()

Implements org.apache.http.HttpMessage.headerIterator.

Returns an iterator of all the headers.
public HeaderIterator
headerIterator(final String
the name of the headers over which to iterate, or null for all headers
name
)

Implements org.apache.http.HttpMessage.headerIterator.

Returns an iterator of the headers with a given name.
public void
removeHeader(final Header
the header to remove.
header
)

Implements org.apache.http.HttpMessage.removeHeader.

Removes a header from this message.
public void
removeHeaders(final String
The name of the headers to remove.
name
)

Implements org.apache.http.HttpMessage.removeHeaders.

Removes all headers with a certain name from this message.
public void
setHeader(final Header
the header to set.
header
)

Implements org.apache.http.HttpMessage.setHeader.

Overwrites the first header with the same name.
public void
setHeader(final String
the name of the header.
name
,
final String
the value of the header.
value
)

Implements org.apache.http.HttpMessage.setHeader.

Overwrites the first header with the same name.
public void
setHeaders(final Header[]
the array of headers to set.
headers
)

Implements org.apache.http.HttpMessage.setHeaders.

Overwrites all the headers in the message.
public void
setParams(final HttpParams
the parameters
params
)

Implements org.apache.http.HttpMessage.setParams.

Deprecated (4.3) use constructor parameters of configuration API provided by HttpClient
Provides parameters to be used for the processing of this message.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

headergroupback to summary
protected HeaderGroup headergroup
paramsback to summary
protected HttpParams params

Deprecated

Do not use.

Annotations
@Deprecated

Constructor Detail

AbstractHttpMessageback to summary
protected AbstractHttpMessage(final HttpParams params)
Annotations
@Deprecated
AbstractHttpMessageback to summary
protected AbstractHttpMessage()

Method Detail

addHeaderback to summary
public void addHeader(final Header header)

Implements org.apache.http.HttpMessage.addHeader.

Doc from org.apache.http.HttpMessage.addHeader.

Adds a header to this message. The header will be appended to the end of the list.

Parameters
header:Header

the header to append.

Annotations
@Override
addHeaderback to summary
public void addHeader(final String name, final String value)

Implements org.apache.http.HttpMessage.addHeader.

Doc from org.apache.http.HttpMessage.addHeader.

Adds a header to this message. The header will be appended to the end of the list.

Parameters
name:String

the name of the header.

value:String

the value of the header.

Annotations
@Override
containsHeaderback to summary
public boolean containsHeader(final String name)

Implements org.apache.http.HttpMessage.containsHeader.

Doc from org.apache.http.HttpMessage.containsHeader.

Checks if a certain header is present in this message. Header values are ignored.

Parameters
name:String

the header name to check for.

Returns:boolean

true if at least one header with this name is present.

Annotations
@Override
getAllHeadersback to summary
public Header[] getAllHeaders()

Implements org.apache.http.HttpMessage.getAllHeaders.

Doc from org.apache.http.HttpMessage.getAllHeaders.

Returns all the headers of this message. Headers are orderd in the sequence they will be sent over a connection.

Returns:Header[]

all the headers of this message

Annotations
@Override
getFirstHeaderback to summary
public Header getFirstHeader(final String name)

Implements org.apache.http.HttpMessage.getFirstHeader.

Doc from org.apache.http.HttpMessage.getFirstHeader.

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:String

the name of the header to return.

Returns:Header

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

Annotations
@Override
getHeadersback to summary
public Header[] getHeaders(final String name)

Implements org.apache.http.HttpMessage.getHeaders.

Doc from org.apache.http.HttpMessage.getHeaders.

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:String

the name of the headers to return.

Returns:Header[]

the headers whose name property equals name.

Annotations
@Override
getLastHeaderback to summary
public Header getLastHeader(final String name)

Implements org.apache.http.HttpMessage.getLastHeader.

Doc from org.apache.http.HttpMessage.getLastHeader.

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:String

the name of the header to return.

Returns:Header

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

Annotations
@Override
getParamsback to summary
public HttpParams getParams()

Implements org.apache.http.HttpMessage.getParams.

Doc from org.apache.http.HttpMessage.getParams.

Deprecated

(4.3) use constructor parameters of configuration API provided by HttpClient

Returns the parameters effective for this message as set by setParams(HttpParams).

Annotations
@Override
@Deprecated
headerIteratorback to summary
public HeaderIterator headerIterator()

Implements org.apache.http.HttpMessage.headerIterator.

Doc from org.apache.http.HttpMessage.headerIterator.

Returns an iterator of all the headers.

Returns:HeaderIterator

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

Annotations
@Override
headerIteratorback to summary
public HeaderIterator headerIterator(final String name)

Implements org.apache.http.HttpMessage.headerIterator.

Doc from org.apache.http.HttpMessage.headerIterator.

Returns an iterator of the headers with a given name.

Parameters
name:String

the name of the headers over which to iterate, or null for all headers

Returns:HeaderIterator

Iterator that returns Header objects with the argument name in the sequence they are sent over a connection.

Annotations
@Override
removeHeaderback to summary
public void removeHeader(final Header header)

Implements org.apache.http.HttpMessage.removeHeader.

Doc from org.apache.http.HttpMessage.removeHeader.

Removes a header from this message.

Parameters
header:Header

the header to remove.

Annotations
@Override
removeHeadersback to summary
public void removeHeaders(final String name)

Implements org.apache.http.HttpMessage.removeHeaders.

Doc from org.apache.http.HttpMessage.removeHeaders.

Removes all headers with a certain name from this message.

Parameters
name:String

The name of the headers to remove.

Annotations
@Override
setHeaderback to summary
public void setHeader(final Header header)

Implements org.apache.http.HttpMessage.setHeader.

Doc from org.apache.http.HttpMessage.setHeader.

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:Header

the header to set.

Annotations
@Override
setHeaderback to summary
public void setHeader(final String name, final String value)

Implements org.apache.http.HttpMessage.setHeader.

Doc from org.apache.http.HttpMessage.setHeader.

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:String

the name of the header.

value:String

the value of the header.

Annotations
@Override
setHeadersback to summary
public void setHeaders(final Header[] headers)

Implements org.apache.http.HttpMessage.setHeaders.

Doc from org.apache.http.HttpMessage.setHeaders.

Overwrites all the headers in the message.

Parameters
headers:Header[]

the array of headers to set.

Annotations
@Override
setParamsback to summary
public void setParams(final HttpParams params)

Implements org.apache.http.HttpMessage.setParams.

Doc from org.apache.http.HttpMessage.setParams.

Deprecated

(4.3) use constructor parameters of configuration API provided by HttpClient

Provides parameters to be used for the processing of this message.

Parameters
params:HttpParams

the parameters

Annotations
@Override
@Deprecated