aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/03-api/03-fields/json.janet14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/03-api/03-fields/json.janet b/test/03-api/03-fields/json.janet
new file mode 100644
index 0000000..a0d5aea
--- /dev/null
+++ b/test/03-api/03-fields/json.janet
@@ -0,0 +1,14 @@
+(use ../../../jurl)
+(import spork/json)
+
+(def body {:abc "xyz"
+ :foo "bar"})
+
+(def req (->> "https://pie.dev/post"
+ (http :post)
+ (json body)))
+(def res (req))
+(assert (= 200 (res :status)))
+(def jes (freeze ((json/decode (res :body) true) :json)))
+
+(assert (= body jes))