Monday, March 24, 2014 at 6:53:33 PM

Hi,

I’m trying to figure out the best way to capture JSON input into an Active4D 
page. (Using 4D version 14, Active4D version 6.1.)

I can use the 4D command:

WEB GET HTTP BODY (inJSON)

which will grab the body of the incoming request and put it into a BLOB var 
(inJSON), which I can then work with on the page.

However, if I do this all in Active4D, will this work?

$a4d_collection := new collection
$a4d_collection ::= parse json (BLOB to text(_form{"_data_"})) 

The question I have (that I couldn’t find a specific answer in the docs) is 
whether I can capture the incoming data using:

_form{"_data_"}

The docs mention that this will work for XML; I’m assuming the same for JSON?

Or is there a better way to do this?

(I did some initial testing using a normal Form variable with JSON content, and 
the “parse json” command works great in converting the json into a collection. 
So just need to know if “_form{"_data_"}” works for capturing the request, or 
if there’s some other method even better for doing this.)

Thanks!

Michael Larue

_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to