diff options
author | adamw <adam@warski.org> | 2017-10-06 14:19:44 +0200 |
---|---|---|
committer | adamw <adam@warski.org> | 2017-10-06 14:19:44 +0200 |
commit | bb7abc189d9a5f079caa47a4508b5ae585dc8bcf (patch) | |
tree | 4d096e1b0c78156df923a7cf3282a86507b8ef8b /README.md | |
parent | 43baccc0edf12e8951c903d6697d7ee24a201e63 (diff) | |
download | sttp-bb7abc189d9a5f079caa47a4508b5ae585dc8bcf.tar.gz sttp-bb7abc189d9a5f079caa47a4508b5ae585dc8bcf.tar.bz2 sttp-bb7abc189d9a5f079caa47a4508b5ae585dc8bcf.zip |
#10: add proxy support
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -489,8 +489,9 @@ How to use: import com.softwaremill.sttp._ import scala.concurrent.duration._ -// all backends provide a constructor that allows users to specify connection timeout -implicit val backend = HttpURLConnectionBackend(connectionTimeout = 1.minute) +// all backends provide a constructor that allows users to specify backend options +implicit val backend = HttpURLConnectionBackend( + options = SttpBackendOptions.connectionTimeout(1.minute)) sttp .get(uri"...") @@ -498,6 +499,21 @@ sttp .send() ``` +## Proxy + +A proxy can be specified when creating a backend: + +```scala +import com.softwaremill.sttp._ + +implicit val backend = HttpURLConnectionBackend( + options = SttpBackendOptions.httpProxy("some.host", 8080)) + +sttp + .get(uri"...") + .send() // uses the proxy +``` + ## SSL SSL handling can be customized (or disabled) when creating a backend and is |