How do I get JSON Post to work correctly?

Get help using Construct 2

Post » Sat Apr 11, 2015 4:37 pm

The data will not write to the JSON file.
I followed the manual, some forum posts etc. Running this from my server, shouldnt be a cross-domain issue as best I can tell.

Here is a link to my capX
http://jackrdavis.com/phpTest2/phpTest2.capx
Last edited by CigarOfSinatra on Sat Apr 11, 2015 8:21 pm, edited 1 time in total.
B
11
S
2
Posts: 40
Reputation: 680

Post » Sat Apr 11, 2015 7:01 pm

Your link doesn't work but I guessed at phpTest2.capx.

You want to set the data to "key=value" so it would be something like:
Data: "plantData="&URLEncode(plantData.AsJSON)
Then in PHP you can access $_POST["plantData"].
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Sat Apr 11, 2015 8:23 pm

@ramones Thanks for pointing that out! Fixed the link.

Ok, so I need a script on the server to process it. Sounds good. Time to do some reading.
B
11
S
2
Posts: 40
Reputation: 680


Return to How do I....?

Who is online

Users browsing this forum: JDebstup, Leef and 22 guests