git.iko.soy/rowtype-yoga/purescript-fetch
on main help sign in
Update readme
commit659294829d87caec47ed88ab476d22c39d22e9b6 authorsigma-andex <77549848+sigma-andex@users.noreply.github.com> dateTue 23 Aug 2022, 18:50 (4 years ago) parent3a89274
1 file changed+2−2
README.md+2−2
README.md+2−2
@@ -54,7 +54,7 @@ main :: Effect Unit
5454main = launchAff_ do
5555 { json } <- fetch "https://httpbin.org/post"
5656 { method: POST
57− , body: """{"hello":"world"}"""
57+ , body: writeJSON { hello: "world" }
5858 , headers: { "Content-Type": "application/json" }
5959 }
6060 { json: { hello: world } } :: HttpBinResponse <- fromJSON json
@@ -73,7 +73,7 @@ type HttpBinResponse = { json :: { hello :: String } }
7373do
7474 { json } <- fetch "https://httpbin.org/post"
7575 { method: POST
76− , body: """{"hello":"world"}"""
76+ , body: toJsonString { hello: "world" }
7777 , headers: { "Content-Type": "application/json" }
7878 }
7979 { json: { hello: world } } :: HttpBinResponse <- fromJson json