-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Migrated to Parse Server okay but can't get it working with my appcelerator apps
Tried converting the cURL commands into an HTTPclient request but no luck
exports.queryLocations = function(coords, callback) {
var parseURL = Alloy.Globals.PARSE_URL + "classes/Test";
var params = {
'limit' : 10
};
var params = {
'limit' : 10,
'where' : {
"location" : {
"$nearSphere" : {
"__type" : "GeoPoint",
"latitude" : coords.lat,
"longitude" : coords.lng
}
}
}
};
var xhr = Ti.Network.createHTTPClient({
onload : function() {
callback(false, this.responseText);
},
onerror : function() {
callback(true, this.responseText);
},
timeout : 5000
});
xhr.open("GET", parseURL);
xhr.setRequestHeader("X-Parse-Application-Id", Alloy.Globals.PARSE_APP_ID);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(params));
// xhr.send();
};
Metadata
Metadata
Assignees
Labels
No labels