Wednesday, April 25, 2012

Facebook batch calls with JSONP

As of 10.04.2012,
There is a short paragraph in the Facebook developer document for 'batch request' entitled: Batch calls with JSONP, which reads:

"The Batch API supports JSONP, just like the rest of the Graph API - 
the JSONP callback function is specified using the 'callback' query string
or form post parameter."

I thought that meant you can also do a batch request using JSONP from Javascript (which will be a GET request, as JSONP works only as a GET request), so I tried that, with adding a 'batch' parameter (containing objects describing requests for batch as in the doc) to the query string.
Response from FB server was:

Only POST is allowed for batch requests

So, questions:

1. What did they mean in that paragraph?

2. Is there a way to do an asynchronous batch request from Javascript?

No comments:

Post a Comment