diff options
author | adamw <adam@warski.org> | 2017-10-12 19:23:09 +0200 |
---|---|---|
committer | adamw <adam@warski.org> | 2017-10-12 19:23:09 +0200 |
commit | 7bf4d02da823c21b27cf20ba0b764b511ac69432 (patch) | |
tree | 04b9ab557c4af82b9970af386e6f4f9e4292e472 /docs/conf/timeouts.rst | |
parent | 7885188a982c193e26f8ca6bc9aea8f6a642b32d (diff) | |
download | sttp-7bf4d02da823c21b27cf20ba0b764b511ac69432.tar.gz sttp-7bf4d02da823c21b27cf20ba0b764b511ac69432.tar.bz2 sttp-7bf4d02da823c21b27cf20ba0b764b511ac69432.zip |
More docs
Diffstat (limited to 'docs/conf/timeouts.rst')
-rw-r--r-- | docs/conf/timeouts.rst | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/conf/timeouts.rst b/docs/conf/timeouts.rst new file mode 100644 index 0000000..72b2f4a --- /dev/null +++ b/docs/conf/timeouts.rst @@ -0,0 +1,23 @@ +Timeouts +======== + +Sttp supports read and connection timeouts: + +* Connection timeout - can be set globally (30 seconds by default) +* Read timeout - can be set per request (1 minute by default) + +How to use:: + + import com.softwaremill.sttp._ + import scala.concurrent.duration._ + + // all backends provide a constructor that allows users to specify backend options + implicit val backend = HttpURLConnectionBackend( + options = SttpBackendOptions.connectionTimeout(1.minute)) + + sttp + .get(uri"...") + .readTimeout(5.minutes) // or Duration.Inf to turn read timeout off + .send() + + |