aboutsummaryrefslogtreecommitdiff
path: root/test/03-api/02-body/post.janet
diff options
context:
space:
mode:
Diffstat (limited to 'test/03-api/02-body/post.janet')
-rw-r--r--test/03-api/02-body/post.janet11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/03-api/02-body/post.janet b/test/03-api/02-body/post.janet
new file mode 100644
index 0000000..7885e09
--- /dev/null
+++ b/test/03-api/02-body/post.janet
@@ -0,0 +1,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])))