@@ -35,9 +35,10 @@ Every response is automatically cached in memory, making all subsequent requests
35
35
36
36
``` scala
37
37
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
39
40
40
- given backend : SttpBackend [ Identity , Any ] = HttpClientSyncBackend ()
41
+ given backend : SyncBackend = HttpClientSyncBackend ()
41
42
val client = PokeApiClient ()
42
43
43
44
val berry = client.send(BerryRequest (1 ))
@@ -48,10 +49,11 @@ println(berry.name)
48
49
49
50
``` scala
50
51
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
52
54
import scala .util .*
53
55
54
- given backend : SttpBackend [Try , Any ] = TryHttpURLConnectionBackend ( )
56
+ given backend : Backend [Try ] = TryBackend ( DefaultSyncBackend () )
55
57
val client = PokeApiClient ()
56
58
57
59
client.send(MoveRequest (" pound" )) match {
@@ -64,13 +66,13 @@ client.send(MoveRequest("pound")) match {
64
66
65
67
``` scala
66
68
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
+
70
72
import scala .concurrent .Future
71
73
import scala .util .*
72
74
73
- given backend : SttpBackend [Future , WebSockets ] = HttpClientFutureBackend ()
75
+ given backend : Backend [Future ] = HttpClientFutureBackend ()
74
76
val client = PokeApiClient ()
75
77
76
78
client.send(ContestTypeRequest (1 )).onComplete {
0 commit comments