CGI and JSON

Q&A's, tips, howto's
Locked
Kirill
Posts: 90
Joined: Wed Oct 31, 2007 1:21 pm

CGI and JSON

Post by Kirill »

Greetings!

Never thought of it before, but with json-parse being a built-in function, it's easy to check if CONTENT_TYPE is application/json and then parse POST-ed data as JSON and otherwise as old skool form data.

Now I can move on to build my lightweight webhook processing engine in newLISP. Yay!

K.

Kirill
Posts: 90
Joined: Wed Oct 31, 2007 1:21 pm

Re: CGI and JSON

Post by Kirill »

Very lightweight and simple. Does what I need.
Attachments
Screenshot_2021-05-05_10-40-31.png
Screenshot_2021-05-05_10-40-31.png (80.58 KiB) Viewed 2234 times

Kirill
Posts: 90
Joined: Wed Oct 31, 2007 1:21 pm

Re: CGI and JSON

Post by Kirill »

Never thought of it before, but with json-parse being a built-in function, it's easy to check if CONTENT_TYPE is application/json and then parse POST-ed data as JSON and otherwise as old skool form data.
newLISP JSON parsing seem to choke when JSON lines end with \r\n rather than \n.

Locked