meteor-rest
meteor-rest copied to clipboard
json response with Meteor.call
CALLED function : Meteor.methods({ apicheck:function(o){ return {"r":100}; }, });
this is returning string "{"r":100}" even though, the response's content-type: "application/json"
How are you calling it?
CALLING function
var zRet= Meteor.http.post( "http://localhost:5000/methods/apiheck", { headers: { "Accept":"/" }, params: a });
zRet is string "{"r":100}"
What is Meteor.http? Maybe it does not auto-convert JSON to an object.
Meteor.http is the old backcompat name for HTTP from the http package.
Oh wow don't remember that one anymore. :)