org.apache.http
public interface: HttpMessage [javadoc |
source]
All Known Implementing Classes:
HttpResponse, BasicHttpRequest, HttpPost, HttpHead, BasicHttpEntityEnclosingRequest, AbstractHttpMessage, HttpMessageMockup, BasicHttpResponse, HttpGet, HttpEntityEnclosingRequest, HttpRequest
HTTP messages consist of requests from client to server and responses
from server to client.
HTTP-message = Request | Response ; HTTP/1.1 messages
HTTP messages use the generic message format of RFC 822 for
transferring entities (the payload of the message). Both types
of message consist of a start-line, zero or more header fields
(also known as "headers"), an empty line (i.e., a line with nothing
preceding the CRLF) indicating the end of the header fields,
and possibly a message-body.
generic-message = start-line
*(message-header CRLF)
CRLF
[ message-body ]
start-line = Request-Line | Status-Line
- version:
$
- Revision: 744522 $
- since:
4.0
-
Method from org.apache.http.HttpMessage Summary: |
---|
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, getProtocolVersion, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams |
Method from org.apache.http.HttpMessage Detail: |
public void addHeader(Header header)
Adds a header to this message. The header will be appended to the end of
the list. |
public void addHeader(String name,
String value)
Adds a header to this message. The header will be appended to the end of
the list. |
public boolean containsHeader(String name)
Checks if a certain header is present in this message. Header values are
ignored. |
public Header[] getAllHeaders()
Returns all the headers of this message. Headers are orderd in the sequence
they will be sent over a connection. |
public Header getFirstHeader(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. |
public Header[] getHeaders(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. |
public Header getLastHeader(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. |
public HttpParams getParams()
|
public ProtocolVersion getProtocolVersion()
Returns the protocol version this message is compatible with. |
public HeaderIterator headerIterator()
Returns an iterator of all the headers. |
public HeaderIterator headerIterator(String name)
Returns an iterator of the headers with a given name. |
public void removeHeader(Header header)
Removes a header from this message. |
public void removeHeaders(String name)
Removes all headers with a certain name from this message. |
public 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. |
public void setHeader(String name,
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. |
public void setHeaders(Header[] headers)
Overwrites all the headers in the message. |
public void setParams(HttpParams params)
Provides parameters to be used for the processing of this message. |