Copy link to clipboard
Copied
Hi everyone,
In an asc file, I am trying to retrieve some data from a server that uses JSON as its exchange format each time someone connects to a specific application. ( I can't control the exchange format)
To do that I send a POST using the sendAndLoad method of a LoadVars Object.
So far I only managed to get the HTTP header. The target object from the sendAndLoad method seems to be empty .
The response format from the server is like this :
{"result":{"uid":"24947431041778945007157724608309","sid":"20825068196030559827758762683967"}} (I got it by doing a POST with cURL)
Since the data doesn't have the "attribute=value&attribute2=value2..." format, I think I will not be able to get them.
Does anyone know if it is possible to first get and then parse these data using either ServerSide ActionScript's API
or another good method .
Copy link to clipboard
Copied
To make it easier to understand.
I try to retrieve data using the sendandload() method of a Loadvars Object
First question :
Is it a problem if the response data does not look like this : "attribute=value&attribute2=value2..." (it looks like this : {"result":{"uid":"24947431041778945007157724608309","sid":"20825068196 030559827758762683967"}} )
Second Question :
If it is not possible to get the data this way, would it be a good idea to do a Php script to retrieve the data and then format it ?
Copy link to clipboard
Copied
I know it's pretty late, but just posting a helpful resource for anyone else bumping into this thread. Here's a JSON parser which is working quite nicely for me till now: [Removed unavailable URL link by Moderator]
Copy link to clipboard
Copied
link is broken today, any chance to find it elswhere?