Skip to content

Commit 48eb39c

Browse files
committed
Change tutorial to use ujson integr.
1 parent 81d3ed7 commit 48eb39c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

_overviews/toolkit/http-client-json.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ We provide the new location and bio of the profile in a JSON object.
3232
{% tab 'Scala 2' %}
3333
```scala mdoc:compile-only
3434
import sttp.client4.quick._
35+
import sttp.client4.upicklejson._
3536

3637
val json = ujson.Obj(
3738
"location" -> "hometown",
@@ -41,8 +42,7 @@ val json = ujson.Obj(
4142
val response = quickRequest
4243
.patch(uri"https://api.github.com/user")
4344
.auth.bearer(sys.env("GITHUB_TOKEN"))
44-
.header("Content-Type", "application/json")
45-
.body(ujson.write(json))
45+
.body(json)
4646
.send()
4747

4848
println(response.code)
@@ -55,6 +55,7 @@ println(response.body)
5555
{% tab 'Scala 3' %}
5656
```scala
5757
import sttp.client4.quick.*
58+
import sttp.client4.upicklejson.*
5859

5960
val json = ujson.Obj(
6061
"location" -> "hometown",
@@ -64,8 +65,7 @@ val json = ujson.Obj(
6465
val response = quickRequest
6566
.patch(uri"https://api.github.com/user")
6667
.auth.bearer(sys.env("GITHUB_TOKEN"))
67-
.header("Content-Type", "application/json")
68-
.body(ujson.write(json))
68+
.body(json)
6969
.send()
7070

7171
println(response.code)

0 commit comments

Comments
 (0)