public class GrizzlyResponse extends ResponseBase
HttpResponseBodyPart implementation using the Grizzly 2.0 HTTP client
codec.Response.ResponseBuilderbodyParts, headers, status| Constructor and Description |
|---|
GrizzlyResponse(org.glassfish.grizzly.http.HttpResponsePacket httpResponsePacket,
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[].
|
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 GrizzlyResponse(org.glassfish.grizzly.http.HttpResponsePacket httpResponsePacket,
HttpResponseStatus status,
HttpResponseHeaders headers,
List<HttpResponseBodyPart> bodyParts)
public InputStream getResponseBodyAsStream() throws IOException
ResponseIOExceptionpublic String getResponseBodyExcerpt(int maxLength, String charset) throws IOException
ResponsemaxLength - The maximum number of bytes to readcharset - the charset to use when decoding the streamIOExceptionpublic String getResponseBody(String charset) throws IOException
Responsecharset - the charset to use when decoding the streamIOExceptionpublic String getResponseBodyExcerpt(int maxLength) throws IOException
ResponsemaxLength - The maximum number of bytes to readIOExceptionpublic String getResponseBody() throws IOException
ResponseIOExceptionpublic byte[] getResponseBodyAsBytes()
throws IOException
ResponseIOExceptionpublic ByteBuffer getResponseBodyAsByteBuffer() throws IOException
ResponseIOExceptionprotected List<Cookie> buildCookies()
buildCookies in class ResponseBaseCopyright © 2019. All Rights Reserved.