How to POST json or other array to ActiveVFP script

Topics: User Forum
Oct 23, 2012 at 4: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

Coordinator
Oct 23, 2012 at 1:23 PM
Edited Oct 23, 2012 at 1: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:

http://activevfp.codeplex.com/releases/view/52539

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

http://www.sweetpotatosoftware.com/spsblog/2008/12/19/VisualFoxproJSONClassUpdate.aspx

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:

http://qdfoxjson.codeplex.com/   

Oct 23, 2012 at 9: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?

Coordinator
Oct 23, 2012 at 11: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")