com.ibm.wsspi.http
Interface HttpResponse
- public interface HttpResponse
Method Summary
Modifier and Type | Method and Description |
---|---|
|
addCookie(HttpCookie cookie)
Add a cookie object to the message.
|
|
addHeader(java.lang.String name,java.lang.String value)
Append a header on the message using the provided name and value pair.
|
getBody()
Access the output stream representation of the body for this message.
|
|
|
getContentLength()
Query the current content-length header of the message.
|
getCookie(java.lang.String name)
Access the first instance of a cookie with the provided name.
|
|
|
getCookies()
Access a list of all cookies found in this message.
|
|
getCookies(java.lang.String name)
Access a list of all cookie instances matching the provided name.
|
|
getHeader(java.lang.String name)
Access the value associated with the first instance of the target header
name.
|
|
getHeaderNames()
Access a list of all header names found in this message.
|
|
getHeaders()
Access a list of all header values in this message.
|
|
getHeaders(java.lang.String name)
Access a list of all header values for a given header name.
|
|
getReason()
Query the current reason phrase of this message.
|
|
getStatus()
Query the current status code of this message.
|
|
getVersion()
Query the current HTTP version of this message.
|
|
isCommitted()
Check whether the response headers have been committed and sent out on
the network or not.
|
|
isPersistent()
Check whether the connection is persistent or not.
|
|
removeAllHeaders()
Remove all headers and cookies from the message.
|
|
removeCookie(HttpCookie cookie)
Remove a cookie object from the message.
|
|
removeHeader(java.lang.String name)
Remove the target header from the message.
|
|
reset()
Resets the status code, version, and headers.
|
|
setContentLength(long length)
Set the content-length header of this message.
|
|
setHeader(java.lang.String name,java.lang.String value)
Set a header on the message using the provided name and value pair.
|
|
setReason(java.lang.String phrase)
Set the reason phrase to the input value.
|
|
setStatus(int code)
Set the status code to the input value.
|
|
setVersion(java.lang.String version)
Set the HTTP version of this message to the input value.
|
Method Detail
setStatus
- void setStatus(int code)
Set the status code to the input value.
Parameters:
code
- setReason
- void setReason(java.lang.String phrase)
Set the reason phrase to the input value.
Parameters:
phrase
- setVersion
- void setVersion(java.lang.String version)
Set the HTTP version of this message to the input value. This is expected
to be of the form "HTTP/.".
Parameters:
version
- setContentLength
- void setContentLength(long length)
Set the content-length header of this message.
Parameters:
length
- setHeader
- void setHeader(java.lang.String name,
- java.lang.String value)
Set a header on the message using the provided name and value pair. This
will replace any currently existing instances of the header name.
addHeader
- void addHeader(java.lang.String name,
- java.lang.String value)
Append a header on the message using the provided name and value pair. This
will be added to any current instance of the header name.
addCookie
- void addCookie(HttpCookie cookie)
Add a cookie object to the message.
Parameters:
cookie
- removeCookie
- void removeCookie(HttpCookie cookie)
Remove a cookie object from the message.
Parameters:
cookie
- removeHeader
- void removeHeader(java.lang.String name)
Remove the target header from the message.
Parameters:
name
- removeAllHeaders
- void removeAllHeaders()
Remove all headers and cookies from the message.
isCommitted
- boolean isCommitted()
Check whether the response headers have been committed and sent out on
the network or not.
Returns:
boolean
isPersistent
- boolean isPersistent()
Check whether the connection is persistent or not.
Returns:
boolean
reset
- void reset()
Resets the status code, version, and headers.
getStatus
- int getStatus()
Query the current status code of this message.
Returns:
int
getReason
- java.lang.String getReason()
Query the current reason phrase of this message.
Returns:
String
getVersion
- java.lang.String getVersion()
Query the current HTTP version of this message. It will be in the form of
"HTTP/.".
Returns:
String
getContentLength
- long getContentLength()
Query the current content-length header of the message. This will be -1L
if the header is not set.
Returns:
long
getHeader
- java.lang.String getHeader(java.lang.String name)
Access the value associated with the first instance of the target header
name. This will return null if no instance was found.
Parameters:
name
- Returns:
String
getHeaders
- java.util.List<java.lang.String> getHeaders( java.lang.String name)
Access a list of all header values for a given header name. This list is
never null, but might be empty.
Parameters:
name
- Returns:
List
getHeaders
- java.util.List<java.lang.String> getHeaders( )
Access a list of all header values in this message. This list is never null,
but might be empty.
Returns:
List
getHeaderNames
- java.util.List<java.lang.String> getHeaderNames( )
Access a list of all header names found in this message. This list is never
null, but might be empty.
Returns:
List
getCookie
- HttpCookie getCookie(java.lang.String name)
Access the first instance of a cookie with the provided name. This might
be null if no match is found.
Parameters:
name
- Returns:
HttpCookie
getCookies
- java.util.List<HttpCookie> getCookies( java.lang.String name)
Access a list of all cookie instances matching the provided name. This list
is never null, but might be empty.
Parameters:
name
- Returns:
List
getCookies
- java.util.List<HttpCookie> getCookies( )
Access a list of all cookies found in this message. The list is never null,
but might be empty.
Returns:
List
getBody
- HttpOutputStream getBody()
Access the output stream representation of the body for this message.
Returns:
HttpOutputStream