I have a REST server that takes a query string in the request body of a GET statement.
It's similar to the Parse REST api that does the same. As seen in the curl statement below.
curl -X GET \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
-G \
--data-urlencode 'where={"playerName":"Sean Plott","cheatMode":false}' \
https://api.parse.com/1/classes/GameScore
My question is: How do I send a Backbone fetch (essentially a -X GET) with a data string.
Ive tried the following;
fetch: function(options) {
options = _.extend({data: 'Active is true' }, options);
return Backbone.Collection.prototype.fetch.apply(this, arguments);
}
Currently, that appends the string on the URL as parameters as such
http://restserver.com/collection/Customer?Active%20eq%20true