public class HttpRequest.BufferedResponse extends Object
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asBytes()
Return the result as bytes.
|
String |
asString(String encoding)
Return the result as a string.
|
<T> T |
asXml(Class<T> cls)
Return the result as an instance of the given class that has been
deserialized from a XML payload.
|
HttpRequest.BufferedResponse |
saveContent(File file)
Save the result to a file.
|
HttpRequest.BufferedResponse |
saveContent(OutputStream out)
Save the result to an output stream.
|
public byte[] asBytes()
public String asString(String encoding) throws IOException
encoding - the encodingIOException - on I/O errorpublic <T> T asXml(Class<T> cls) throws IOException
IOException - on I/O errorpublic HttpRequest.BufferedResponse saveContent(File file) throws IOException, InterruptedException
file - the fileIOException - on I/O errorInterruptedException - on interruptionpublic HttpRequest.BufferedResponse saveContent(OutputStream out) throws IOException, InterruptedException
out - the output streamIOException - on I/O errorInterruptedException - on interruptionCopyright © 2015. All Rights Reserved.