File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ We provide the new location and bio of the profile in a JSON object.
32
32
{% tab 'Scala 2' %}
33
33
``` scala mdoc:compile-only
34
34
import sttp .client4 .quick ._
35
+ import sttp .client4 .upicklejson ._
35
36
36
37
val json = ujson.Obj (
37
38
" location" -> " hometown" ,
@@ -41,8 +42,7 @@ val json = ujson.Obj(
41
42
val response = quickRequest
42
43
.patch(uri " https://api.github.com/user " )
43
44
.auth.bearer(sys.env(" GITHUB_TOKEN" ))
44
- .header(" Content-Type" , " application/json" )
45
- .body(ujson.write(json))
45
+ .body(json)
46
46
.send()
47
47
48
48
println(response.code)
@@ -55,6 +55,7 @@ println(response.body)
55
55
{% tab 'Scala 3' %}
56
56
``` scala
57
57
import sttp .client4 .quick .*
58
+ import sttp .client4 .upicklejson .*
58
59
59
60
val json = ujson.Obj (
60
61
" location" -> " hometown" ,
@@ -64,8 +65,7 @@ val json = ujson.Obj(
64
65
val response = quickRequest
65
66
.patch(uri " https://api.github.com/user " )
66
67
.auth.bearer(sys.env(" GITHUB_TOKEN" ))
67
- .header(" Content-Type" , " application/json" )
68
- .body(ujson.write(json))
68
+ .body(json)
69
69
.send()
70
70
71
71
println(response.code)
You can’t perform that action at this time.
0 commit comments