[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGI and JSON


Hi all

Currently I'm trying to get running my first web application to build an API Rest Service using JSON to send data back and forth.

I am using Request.Post to retrieve the content of a raw Json POST data with "application/json" header mimetype, but I have no idea how to get the raw content in the request.Post function.

I know how to do it by sending my data as "x-www-form-urlencoded" and it works, but instead I would like to get the entire body of the post response. That is how other devs do it in other languages and seems to be the standard way to deal with JSON data.

When I print CGI.Dump() after my request I can see in the "CONTENT_LENGHT" environment variable the correct lenght of the sent data, but there doesn't seem to be a way to retrieve the actual data.

Benoît, would you shed some light over this?

By the way, I'm using Postman as a tool for crafting the POST requests and it's really a great tool.

https://www.postman.com/downloads/

Thanks in advance

--
Jesus Guardon


Follow-Ups:
Re: CGI and JSONBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>