|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HttpResponse
HttpResponse for the ServerHttpConnection.
| Method Summary | |
|---|---|
HttpHeader |
addHeader(String name,
String value)
Adds a HttpHeader for the response. |
OutputBufferStream |
getBody()
Obtains the OutputBufferStream to write the body of the response. |
HttpHeader |
getHeader(String name)
Obtains the first HttpHeader by the name. |
HttpHeader[] |
getHeaders()
Obtains all the HttpHeader instances for the response. |
void |
removeHeader(HttpHeader header)
Removes the particular HttpHeader from the response. |
void |
removeHeaders(String name)
Removes all HttpHeader instances by the name. |
void |
send()
Sends this HttpResponse. |
void |
setStatus(int status)
Specifies the status of the response with the default status message. |
void |
setStatus(int status,
String statusMessage)
Specifies the status of the response including specifying the status human readable message. |
void |
setVersion(String version)
Allows specifying the HTTP version on the response. |
| Method Detail |
|---|
void setVersion(String version)
Allows specifying the HTTP version on the response. Values should be either HTTP/1.0 or HTTP/1.1.
This defaults to value on HttpRequest.
version - HTTP version.void setStatus(int status)
Specifies the status of the response with the default status message.
This defaults to 200 assuming the request was processed successfully.
status - Status of the response.
void setStatus(int status,
String statusMessage)
status - Status of the response.statusMessage - Human readable status message.setStatus(int)
HttpHeader addHeader(String name,
String value)
Adds a HttpHeader for the response.
HttpHeader instances are provided on the response in the order
they are added.
name - Name of HttpHeader.value - Value of HttpHeader.
HttpHeader instance added.HttpHeader getHeader(String name)
HttpHeader by the name.
name - Name of the HttpHeader.
HttpHeader by the name.HttpHeader[] getHeaders()
HttpHeader instances for the response.
HttpHeader instances for the response.void removeHeader(HttpHeader header)
HttpHeader from the response.
header - HttpHeader to be removed from the response.void removeHeaders(String name)
Removes all HttpHeader instances by the name.
This method compliments addHeader(String, String) to allow
adding a new single HttpHeader instance by name.
name - Name of the HttpHeader instances to remove.OutputBufferStream getBody()
Obtains the OutputBufferStream to write the body of the response.
Closing the returned OutputBufferStream is similar to calling
send().
OutputBufferStream to write the body of the response.send()
void send()
throws IOException
HttpResponse. After calling this getBody() is
closed and the corresponding HttpRequest.getBody() is closed.
IOException - If fails to send this HttpResponse.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||