aboutsummaryrefslogtreecommitdiff
path: root/async-http-client-handler/src/main/scala/com
diff options
context:
space:
mode:
authorPiotr Buda <piotr.buda@softwaremill.com>2017-07-31 11:59:08 +0200
committerPiotr Buda <piotr.buda@softwaremill.com>2017-08-04 16:37:48 +0200
commite6f0ac0289ad3685e2af5dfc17ee79c3c1170bdf (patch)
treec3fda860423c4154bdc73f26f67fe332ce4b1cc6 /async-http-client-handler/src/main/scala/com
parent489e591672257d19b3a07198d4d6c9e21be601c7 (diff)
downloadsttp-e6f0ac0289ad3685e2af5dfc17ee79c3c1170bdf.tar.gz
sttp-e6f0ac0289ad3685e2af5dfc17ee79c3c1170bdf.tar.bz2
sttp-e6f0ac0289ad3685e2af5dfc17ee79c3c1170bdf.zip
#7: Add asFile and asPath responses
Diffstat (limited to 'async-http-client-handler/src/main/scala/com')
-rw-r--r--async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala b/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala
index 9043882..8f75030 100644
--- a/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala
+++ b/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala
@@ -222,6 +222,11 @@ abstract class AsyncHttpClientHandler[R[_], S](asyncHttpClient: AsyncHttpClient,
Failure(
new IllegalStateException(
"Requested a streaming response, trying to read eagerly."))
+
+ case ResponseAsFile(file, overwrite) =>
+ Try(
+ ResponseAs
+ .saveFile(file, response.getResponseBodyAsStream, overwrite))
}
}