diff options
| author | 2023-04-03 10:46:28 -0400 | |
|---|---|---|
| committer | 2023-04-03 10:46:28 -0400 | |
| commit | 1388e78f98cbb6d94fc058c39cfc98614b5b467e (patch) | |
| tree | 7c9f37fd52b5b967ff36e755412bfcea5194fb7c | |
| parent | native: make strings more permissive (diff) | |
test: test json api
| -rw-r--r-- | test/03-api/03-fields/json.janet | 14 |
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)) |
