Closed catmanjan closed 5 years ago
This is what I've got so far - just not sure it's the "ServiceStack way"
String requestUrl =client.createUrl(request);
InputStream inputStream = client.createRequest(requestUrl, "GET", null, null).getInputStream();
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length = 0;
while ((length = inputStream.read(buffer)) != -1) {
byteOutputStream.write(buffer, 0, length);
}
byte[] bytes = byteOutputStream.toByteArray();
The download is not baked into the client. I added a new sample demonstrating one way to do a file download.
Thanks!
client.get(request)
has a return type of void, I need a byte array - here is an extract from my dto file: