@@ -12,7 +12,7 @@ If you use Requests-Scala and like it, you will probably enjoy the following boo
12
12
- [ * Hands-on Scala Programming* ] ( https://www.handsonscala.com/ )
13
13
14
14
* Hands-on Scala* has uses Requests-Scala extensively throughout the book, and has
15
- the entirety of * Chapter 12: Working with HTTP APIs* dedicated to
15
+ the entirety of * Chapter 12: Working with HTTP APIs* dedicated to
16
16
the library. * Hands-on Scala* is a great way to level up your skills in Scala
17
17
in general and Requests-Scala in particular.
18
18
@@ -87,7 +87,7 @@ val r = requests.options("http://httpbin.org/get")
87
87
88
88
``` scala
89
89
val r = requests.get(
90
- " http://httpbin.org/get" ,
90
+ " http://httpbin.org/get" ,
91
91
params = Map (" key1" -> " value1" , " key2" -> " value2" )
92
92
)
93
93
```
@@ -191,9 +191,9 @@ too big to fit in memory, while still benefiting from most of Requests' friendly
191
191
192
192
## Handling JSON
193
193
194
- Requests does not provide any built-in JSON support, but you can easily use a
195
- third-party JSON library to work with it. This example shows how to use
196
- [ uJson] ( http://www.lihaoyi.com/upickle/ ) talk to a HTTP endpoint that requires a
194
+ Requests does not provide any built-in JSON support, but you can easily use a
195
+ third-party JSON library to work with it. This example shows how to use
196
+ [ uJson] ( http://www.lihaoyi.com/upickle/ ) talk to a HTTP endpoint that requires a
197
197
JSON-formatted body, either using ` upickle.default.stream ` :
198
198
199
199
``` scala
@@ -243,9 +243,9 @@ val r = requests.post(
243
243
data = requests.MultiPart (
244
244
requests.MultiItem (" name" , new java.io.File (" build.sc" ), " file.txt" ),
245
245
// you can upload strings, and file name is optional
246
- requests.MultiItem (" name2" , " Hello" ),
246
+ requests.MultiItem (" name2" , " Hello" ),
247
247
// bytes arrays are ok too
248
- requests.MultiItem (" name3" , Array [Byte ](1 , 2 , 3 , 4 ))
248
+ requests.MultiItem (" name3" , Array [Byte ](1 , 2 , 3 , 4 ))
249
249
)
250
250
)
251
251
```
@@ -280,7 +280,7 @@ requests.get("https://httpbin.org/delay/1", readTimeout = 10)
280
280
// TimeoutException
281
281
282
282
requests.get(" https://httpbin.org/delay/1" , readTimeout = 1500 )
283
- // ok
283
+ // ok
284
284
285
285
requests.get(" https://httpbin.org/delay/3" , readTimeout = 1500 )
286
286
// TimeoutException
@@ -490,7 +490,7 @@ headers, cookies or other things:
490
490
491
491
``` scala
492
492
val s = requests.Session (
493
- headers = Map (" x-special-header" -> " omg" ),
493
+ headers = Map (" x-special-header" -> " omg" ),
494
494
cookieValues = Map (" cookie" -> " vanilla" )
495
495
)
496
496
@@ -531,7 +531,7 @@ common Scala HTTP clients:
531
531
``` scala
532
532
// Requests-Scala
533
533
val r = requests.get(
534
- " https://api.github.com/search/repositories" ,
534
+ " https://api.github.com/search/repositories" ,
535
535
params = Map (" q" -> " http language:scala" , " sort" -> " stars" )
536
536
)
537
537
@@ -619,12 +619,12 @@ val query = "http language:scala"
619
619
// the `query` parameter is automatically url-encoded
620
620
// `sort` is removed, as the value is not defined
621
621
val request = sttp.get(uri " https://api.github.com/search/repositories?q= $query&sort= $sort" )
622
-
622
+
623
623
implicit val backend = HttpURLConnectionBackend ()
624
624
val response = request.send()
625
625
626
- // response.unsafeBody: by default read into a String
627
- println(response.unsafeBody)
626
+ // response.unsafeBody: by default read into a String
627
+ println(response.unsafeBody)
628
628
```
629
629
``` scala
630
630
// Dispatch
@@ -656,6 +656,10 @@ codebase or project!
656
656
657
657
## Changelog
658
658
659
+ ### 0.6.7
660
+
661
+ - Add support for Scala 3.0.0-RC2
662
+
659
663
### 0.6.5
660
664
661
665
- ` requests.Response ` now implements the ` geny.Readable ` interface, and can be
0 commit comments