Hi,
I'm trying to write a simple web tool and would like to parse the HTTP post
body. I tried to alter the example on the website of web.l
<https://bitbucket.org/iromero91/web.l/wiki/Home> to read json payload like
this -
(de greet (Greeting)
(res-html "The hello world page" NIL NIL
(<h1> NIL (prin Greeting)) ) )
(dh ("/greeters/" @Name)
(out "+out.txt" (prinl (readJson)))
(let Name (ht:Pack @Name)
(case Name
("bob" (greet "Hello world!"))
("pablo" (greet "Hola mundo!"))
("hans" (greet "Hallo Welt!"))
("sergey" (greet "п?~@иве?~B ми?~@!"))
(T (httpStat 404 "Not found")) ) ) )
This results in endless read :(. What's the right way to read the HTTP body?
Regards,
Kashyap