I'm developing a facebook application which makes a complex multiquery
and returns "big" responce. After getting the request out from the
server (I'm using the api.facebook.com/method/fql.multiquery), I get a
QNetworkReply. I've connected this reply so it writes (when readyRead
signal) the received data into a buffer. At this moment I'm not sure
if it is the best option.
I don't know other approach this matter since I'm not that so
experienced with QT.
How do I process those large replies? Does QJson has such a thing?
I've tried to do this with
QJson::Parser parser;
qDebug()<<r_aux->size();
//r_aux->buffer().prepend("{\"data\":");
//r_aux->buffer().append("}");
QVariant data=parser.parse(r_aux,&ok);
qDebug()<<data;
if (!ok)
qWarning() << "Error while parsing network reply: ";
Where r_aux is my QBuffer. This outputs: 72499 QVariant(, ).
Because my reply starts with "[" and ends "]" I've tried to add my own
{"data": and }, but this fails also. At output 72499
json_parser - syntax error found, forcing abort, Line 1 Column 0
QVariant(qulonglong, 4754)
I know for sure that I get a the same reply I would get from a browser
(I've done the qDebug<<reply->readAll() inside the slot connected to
the readyRead signal)
For testing porpuses I'll provide the url here:
https://api.facebook.com/method/fql.multiquery?format=json&queries=%7B%22query1%22%3A%22SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%3Dme%28%29%22%2C%22query2%22%3A%22SELECT%20uid%2C%20name%20FROM%20user%20WHERE%20uid%20in%28SELECT%20uid2%20FROM%20%23query1%29%22%2C%22query3%22%3A%22SELECT%20uid%2C%20status_id%2Cmessage%2Cplace_id%2Ctime%20FROM%20status%20WHERE%20uid%20IN%20%28SELECT%20uid2%20FROM%20%23query1%29%22%2C%22query4%22%3A%22SELECT%20author_uid%2C%20checkin_id%2Cpage_id%2Ccoords%2Cmessage%2Ctimestamp%20FROM%20checkin%20WHERE%20author_uid%20IN%20%28SELECT%20uid2%20FROM%20%23query1%29%22%2C%22query5%22%3A%22SELECT%20name%2Clatitude%2Clongitude%20FROM%20place%20WHERE%20page_id%20IN%28SELECT%20place_id%20from%20%23query3%29%20OR%20page_id%20IN%28SELECT%20page_id%20FROM%20%23query4%20%29%22%7D&access_token=xxxxxxx
Any ideas will be really appreciated.
Thank you in advance
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
QJson-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qjson-devel