public class HttpResponseWrapper extends Object implements HttpResponse
| 限定符和类型 | 字段和说明 |
|---|---|
private HttpResponse |
response |
| 构造器和说明 |
|---|
HttpResponseWrapper(HttpResponse response) |
| 限定符和类型 | 方法和说明 |
|---|---|
Charset |
charset()
Current Charset used to encode to response as.
|
HttpResponseWrapper |
charset(Charset charset)
For text based responses, sets the Charset to encode the response as.
|
HttpResponseWrapper |
chunked()
Turns the response into a chunked response
after this method is called,
HttpResponse.write(String) should be used to send chunks |
boolean |
containsHeader(String name)
Test to see if this response has a header of the specified name
|
HttpResponseWrapper |
content(byte[] content)
Write binary based content back to the client.
|
HttpResponseWrapper |
content(ByteBuffer buffer)
Write binary based content back to the client.
|
HttpResponseWrapper |
content(String content)
Write text based content back to the client.
|
HttpResponseWrapper |
cookie(HttpCookie httpCookie)
Adds a cookie
|
HttpResponseWrapper |
end()
Marks the response as ended.
|
HttpResponseWrapper |
error(Throwable error)
Marks the response as erroneous.
|
HttpResponseWrapper |
header(String name,
Date value)
Adds a Date (RFC 1123 format) HTTP header.
|
HttpResponseWrapper |
header(String name,
long value)
Adds a numeric HTTP header.
|
HttpResponseWrapper |
header(String name,
String value)
Adds an HTTP header.
|
HttpResponse |
originalResponse() |
int |
status()
Retrieve HTTP status code that this response is going to return.
|
HttpResponseWrapper |
status(int status)
Sets the HTTP status code.
|
HttpResponse |
underlyingResponse() |
HttpResponseWrapper |
underlyingResponse(HttpResponse response) |
HttpResponseWrapper |
write(String content)
Writes immediately to the client without closing the connection.
|
private HttpResponse response
public HttpResponseWrapper(HttpResponse response)
public HttpResponse underlyingResponse()
public HttpResponseWrapper underlyingResponse(HttpResponse response)
public HttpResponse originalResponse()
public HttpResponseWrapper charset(Charset charset)
HttpResponsecharset 在接口中 HttpResponsepublic Charset charset()
HttpResponsecharset 在接口中 HttpResponseHttpResponse.charset(java.nio.charset.Charset)public HttpResponseWrapper chunked()
HttpResponseHttpResponse.write(String) should be used to send chunkschunked 在接口中 HttpResponsepublic HttpResponseWrapper status(int status)
HttpResponsestatus 在接口中 HttpResponsepublic int status()
HttpResponsestatus 在接口中 HttpResponseHttpResponse.status(int)public HttpResponseWrapper header(String name, String value)
HttpResponseheader 在接口中 HttpResponsepublic HttpResponseWrapper header(String name, long value)
HttpResponseheader 在接口中 HttpResponsepublic HttpResponseWrapper cookie(HttpCookie httpCookie)
HttpResponsecookie 在接口中 HttpResponsehttpCookie - the cookiepublic HttpResponseWrapper content(String content)
HttpResponsepublic HttpResponseWrapper write(String content)
HttpResponseHttpResponse.content(String) method caches content until HttpResponse.end() is called()
TODO: Make content write immediately instead and remove this method?write 在接口中 HttpResponsecontent - what to writepublic HttpResponseWrapper content(byte[] content)
HttpResponsecontent 在接口中 HttpResponseHttpResponse.content(String)public HttpResponseWrapper content(ByteBuffer buffer)
HttpResponsecontent 在接口中 HttpResponseHttpResponse.content(String)public HttpResponseWrapper error(Throwable error)
HttpResponseHttpResponse.end() or HttpResponse.error(Throwable) called. No more
operations should be performed on a response after these.error 在接口中 HttpResponsepublic HttpResponseWrapper end()
HttpResponseHttpResponse.end() or HttpResponse.error(Throwable) called. No more
operations should be performed on a response after these.end 在接口中 HttpResponsepublic HttpResponseWrapper header(String name, Date value)
HttpResponseheader 在接口中 HttpResponsepublic boolean containsHeader(String name)
HttpResponsecontainsHeader 在接口中 HttpResponseCopyright © 2014. All rights reserved.