• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Need to retrieve JSON data in asc file

New Here ,
Dec 22, 2011 Dec 22, 2011

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 .

Views

1.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 27, 2011 Dec 27, 2011

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 ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 26, 2013 Aug 26, 2013

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]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 23, 2020 Jul 23, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines