Skip to main content
Participant
December 22, 2011
Question

Need to retrieve JSON data in asc file

  • December 22, 2011
  • 2 replies
  • 1877 views

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 .

This topic has been closed for replies.

2 replies

Participating Frequently
August 26, 2013

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]

Robert Mc Dowell
Legend
July 23, 2020

link is broken today, any chance to find it elswhere?

Participant
December 27, 2011

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 ?