diff options
| author | 2021-10-04 13:59:38 +0200 | |
|---|---|---|
| committer | 2021-10-04 13:59:38 +0200 | |
| commit | dae85a6d0b5e3f14e0a44a516068c7af654c76b3 (patch) | |
| tree | 69a03898ef4edfdb6a640340e313ea4694d2250c /test | |
| parent | Handle bad max read limitation issue. (diff) | |
Fix reading request from connection in http
Also fix default port and some typos.
Diffstat (limited to 'test')
| -rw-r--r-- | test/suite0012.janet | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/suite0012.janet b/test/suite0012.janet index d028c66..a41f235 100644 --- a/test/suite0012.janet +++ b/test/suite0012.janet @@ -46,4 +46,12 @@ (test-http-item (http/request "GET" "http://127.0.0.1:9816") nil nil 200 {"content-length" "1"})) +(defn body-server + [req] + {:status 200 :body (string (http/read-body req))}) + +(with [server (http/server body-server "127.0.0.1" 9816)] + (test-http-item (http/request "POST" "http://127.0.0.1:9816" + :body "Strong and healthy") + nil nil 200 {"content-length" "18"})) (end-suite) |
