Why, oh why does the callback function never get called in the example below:
On client:
Meteor.call( "contact_persons_search", values, function(error, result) {
if (error) {
console.log('ERRR');
console.log(error);
} else {
console.log('RESULT');
console.log(result);
}
});
On server:
Meteor.methods({
contact_persons_search: function( values ) {
var result = Meteor.call( "bing_search", "'search query'" );
return result;
},
bing_search: function (query) {
var appKey = "my app key";
var authHeader = "Basic " + Base64.encode(appKey + ":" + appKey);
var options = {
headers: {
'Content-Type': 'application/json',
'Authorization': authHeader
},
params: {
Query: query,
'$format': 'json'
}
};
var result = HTTP.call('GET', 'https://api.datamarket.azure.com/Bing/Search/v1/Web', options);
return result;
},