This is sorted thanks for your help,
I am trying to access the data in python, I am getting the data in XML format.
how do I parse the XML out put as per my requirment, is there a way to convert it to JSON format in (keyair) values.?
Is there any guid to access the data in data by parsing it?
Our basic guide just covers how you can get the data. You should be able to specify the header options to expect JSON data or modify the content-type of your POST request.
{'content-type' : 'application/x-www-form-urlencoded'}
The data returned is still going to be array format (data.rows and data.headers) and not key value pair, but you can do a simple transformation to get rest data into json data. I had a small function for that as below:
function restDataToJSON (restData) { var i, j; var json = []; if (restData && restData.rows) { for (i = 0; i < restData.rows.length; i += 1) { var row = {}; for (j = 0; j < restData.rows[i].length; j += 1) { row[restData.headers[j]] = restData.rows[i][j]; } json.push(row); } } return json; }
Members | Likes |
---|---|
43 | |
36 | |
23 | |
17 | |
16 |