public class JDKResponse extends ResponseBase
Response.ResponseBuilderbodyParts, headers, status| Constructor and Description |
|---|
JDKResponse(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 JDKResponse(HttpResponseStatus status, HttpResponseHeaders headers, List<HttpResponseBodyPart> bodyParts)
public String getResponseBody() throws IOException
ResponseIOExceptionpublic byte[] getResponseBodyAsBytes()
throws IOException
ResponseIOExceptionpublic ByteBuffer getResponseBodyAsByteBuffer() throws IOException
ResponseIOExceptionpublic String getResponseBody(String charset) throws IOException
Responsecharset - the charset to use when decoding the streamIOExceptionpublic InputStream getResponseBodyAsStream() throws IOException
ResponseIOExceptionpublic 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 © 2015. All Rights Reserved.