public interface HttpMessage extends MessageHeaders
Modifier and Type | Method and Description |
---|---|
void |
addHeader(Header header)
Adds a header to this message.
|
void |
addHeader(String name,
Object value)
Adds a header to this message.
|
ProtocolVersion |
getVersion()
Returns protocol version or
null when not available. |
boolean |
removeHeader(Header header)
Removes a header from this message.
|
boolean |
removeHeaders(String name)
Removes all headers with a certain name from this message.
|
void |
setHeader(Header header)
Overwrites the first header with the same name.
|
void |
setHeader(String name,
Object value)
Overwrites the first header with the same name.
|
void |
setHeaders(Header... headers)
Overwrites all the headers in the message.
|
void |
setVersion(ProtocolVersion version)
Sets protocol version.
|
containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator
void setVersion(ProtocolVersion version)
For incoming messages it represents protocol version this message was transmitted with. For outgoing messages it represents a hint what protocol version should be used to transmit the message.
version
- The protocol version.ProtocolVersion getVersion()
null
when not available.
For incoming messages it represents protocol version this message was transmitted with. For outgoing messages it represents a hint what protocol version should be used to transmit the message.
void addHeader(Header header)
header
- the header to append.void addHeader(String name, Object value)
name
- the name of the header.value
- the value of the header, taken as the value's Object.toString()
.void setHeader(Header header)
header
- the header to set.void setHeader(String name, Object value)
name
- the name of the header.value
- the value of the header, taken as the value's Object.toString()
.void setHeaders(Header... headers)
headers
- the array of headers to set.boolean removeHeader(Header header)
header
- the header to remove.true
if a header was removed as a result of this call.boolean removeHeaders(String name)
name
- The name of the headers to remove.true
if any header was removed as a result of this call.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.