public class ApacheResponse extends ResponseBase
Response.ResponseBuilder
bodyParts, headers, status
Constructor and Description |
---|
ApacheResponse(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, isRedirected
public ApacheResponse(HttpResponseStatus status, HttpResponseHeaders headers, List<HttpResponseBodyPart> bodyParts)
public byte[] getResponseBodyAsBytes() throws IOException
Response
IOException
public ByteBuffer getResponseBodyAsByteBuffer() throws IOException
Response
IOException
public String getResponseBody() throws IOException
Response
IOException
public String getResponseBody(String charset) throws IOException
Response
charset
- the charset to use when decoding the streamIOException
public InputStream getResponseBodyAsStream() throws IOException
Response
IOException
public String getResponseBodyExcerpt(int maxLength) throws IOException
Response
maxLength
- The maximum number of bytes to readIOException
public String getResponseBodyExcerpt(int maxLength, String charset) throws IOException
Response
maxLength
- The maximum number of bytes to readcharset
- the charset to use when decoding the streamIOException
protected List<Cookie> buildCookies()
buildCookies
in class ResponseBase
Copyright © 2014. All Rights Reserved.