Skip to content

Commit f2d33b5

Browse files
committed
fix docs
1 parent 2789980 commit f2d33b5

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ Every response is automatically cached in memory, making all subsequent requests
3535

3636
```scala
3737
import io.github.juliano.pokeapi.requests.BerryRequest
38-
import sttp.client4.{ HttpClientSyncBackend, Identity, SttpBackend }
38+
import sttp.client4.httpclient.HttpClientSyncBackend
39+
import sttp.client4.SyncBackend
3940

40-
given backend: SttpBackend[Identity, Any] = HttpClientSyncBackend()
41+
given backend: SyncBackend = HttpClientSyncBackend()
4142
val client = PokeApiClient()
4243

4344
val berry = client.send(BerryRequest(1))
@@ -48,10 +49,11 @@ println(berry.name)
4849

4950
```scala
5051
import io.github.juliano.pokeapi.requests.MoveRequest
51-
import sttp.client4.{ SttpBackend, TryHttpURLConnectionBackend }
52+
import sttp.client4.{ Backend, DefaultSyncBackend }
53+
import sttp.client4.wrappers.TryBackend
5254
import scala.util.*
5355

54-
given backend: SttpBackend[Try, Any] = TryHttpURLConnectionBackend()
56+
given backend: Backend[Try] = TryBackend(DefaultSyncBackend())
5557
val client = PokeApiClient()
5658

5759
client.send(MoveRequest("pound")) match {
@@ -64,13 +66,13 @@ client.send(MoveRequest("pound")) match {
6466

6567
```scala
6668
import io.github.juliano.pokeapi.requests.ContestTypeRequest
67-
import sttp.capabilities.WebSockets
68-
import sttp.client4.{ HttpClientFutureBackend, SttpBackend }
69-
import scala.concurrent.ExecutionContext.Implicits.global
69+
import sttp.client4.Backend
70+
import sttp.client4.httpclient.HttpClientFutureBackend
71+
7072
import scala.concurrent.Future
7173
import scala.util.*
7274

73-
given backend: SttpBackend[Future, WebSockets] = HttpClientFutureBackend()
75+
given backend: Backend[Future] = HttpClientFutureBackend()
7476
val client = PokeApiClient()
7577

7678
client.send(ContestTypeRequest(1)).onComplete {

src/test/scala/io/github/juliano/pokeapi/ContestsSuite.scala

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.github.juliano.pokeapi
22

33
import io.github.juliano.pokeapi.requests.*
4-
import sttp.capabilities.WebSockets
54
import sttp.client4.Backend
65
import sttp.client4.httpclient.HttpClientFutureBackend
76

0 commit comments

Comments
 (0)