How to POST json or other array to ActiveVFP script

Topics: User Forum
Oct 23, 2012 at 3:34 AM

I have a situation where I need to post a substantial amount of data from another application to an ActiveVFP page.  I have looked through the docs and can't seem to find anything other than the usual single form fields method.  Has anyone posted an array via json or some other method to an ActiveVFP page? Thanks, Jeff

Oct 23, 2012 at 12:23 PM
Edited Oct 23, 2012 at 12:24 PM

You should be able to de-serialize any object or array sent over in JSON.  Check out the methods available in either the JSON.prg in the source here:

or directly from Craig Boyd's json.prg here:

That was the most complete JSON class I could find.  However, if you find one you like more or think is better you can easily substitute it in AVFP.  One worth investigating is:   

Oct 23, 2012 at 8:38 PM

Ok that is what I was thinking but I could not tell how to access the serialized JSON. Could you tell me what object it would be in? Would it be in a server variable or somewhere else?

Oct 23, 2012 at 10:34 PM

If a GET (passed on the URL), use oRequest.QueryString("whatever")

If a POST (passed in a FORM), then use oRequest.FORM("whatever")