diff options
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 |