public class NettyResponse extends ResponseBase
Response API.Response.ResponseBuilderbodyParts, headers, status| Constructor and Description |
|---|
NettyResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
List<HttpResponseBodyPart> bodyParts) |
| Modifier and Type | Method and Description |
|---|---|
protected List<Cookie> |
buildCookies() |
String |
getResponseBody()
Return the entire response body as a String.
|
String |
getResponseBody(String charset)
Return the entire response body as a String.
|
ByteBuffer |
getResponseBodyAsByteBuffer()
Return the entire response body as a ByteBuffer.
|
byte[] |
getResponseBodyAsBytes()
Return the entire response body as a byte[].
|
org.jboss.netty.buffer.ChannelBuffer |
getResponseBodyAsChannelBuffer() |
InputStream |
getResponseBodyAsStream()
Returns an input stream for the response body.
|
String |
getResponseBodyExcerpt(int maxLength)
Returns the first maxLength bytes of the response body as a string.
|
String |
getResponseBodyExcerpt(int maxLength,
String charset)
Returns the first maxLength bytes of the response body as a string.
|
calculateCharset, getContentType, getCookies, getHeader, getHeaders, getHeaders, getStatusCode, getStatusText, getUri, hasResponseBody, hasResponseHeaders, hasResponseStatus, isRedirectedpublic NettyResponse(HttpResponseStatus status, HttpResponseHeaders headers, List<HttpResponseBodyPart> bodyParts)
public byte[] getResponseBodyAsBytes()
throws IOException
ResponseIOExceptionpublic ByteBuffer getResponseBodyAsByteBuffer() throws IOException
ResponseIOExceptionpublic String getResponseBody() throws IOException
ResponseIOExceptionpublic String getResponseBody(String charset) throws IOException
Responsecharset - the charset to use when decoding the streamIOExceptionpublic InputStream getResponseBodyAsStream() throws IOException
ResponseIOExceptionpublic org.jboss.netty.buffer.ChannelBuffer getResponseBodyAsChannelBuffer()
throws IOException
IOExceptionpublic String getResponseBodyExcerpt(int maxLength) throws IOException
ResponsemaxLength - The maximum number of bytes to readIOExceptionpublic String getResponseBodyExcerpt(int maxLength, String charset) throws IOException
ResponsemaxLength - The maximum number of bytes to readcharset - the charset to use when decoding the streamIOExceptionprotected List<Cookie> buildCookies()
buildCookies in class ResponseBaseCopyright © 2014. All Rights Reserved.