aboutsummaryrefslogtreecommitdiff
path: root/test/03-api/02-body/post.janet
blob: 7885e0969075b29652b6c3d0d7a84c4da10fbbae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
(use ../../../jurl)
(import spork/json)
(def body "hi")
(def res ((->> "https://pie.dev/anything"
               (http :post)
               (body-plain body))))
(assert (= 200 (res :status)))
(def bres (json/decode (res :body) true))
(assert (= "POST" (bres :method)))
(assert (= body (bres :data)))
(assert (= "text/plain" (get-in bres [:headers :Content-Type])))