meteor-rest icon indicating copy to clipboard operation
meteor-rest copied to clipboard

json response with Meteor.call

Open navinSing opened this issue 10 years ago • 5 comments

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"

navinSing avatar Oct 25 '15 16:10 navinSing

How are you calling it?

stubailo avatar Oct 25 '15 20:10 stubailo

CALLING function

var zRet= Meteor.http.post( "http://localhost:5000/methods/apiheck", { headers: { "Accept":"/" }, params: a });

zRet is string "{"r":100}"

navinSing avatar Oct 31 '15 05:10 navinSing

What is Meteor.http? Maybe it does not auto-convert JSON to an object.

aldeed avatar Nov 19 '15 00:11 aldeed

Meteor.http is the old backcompat name for HTTP from the http package.

stubailo avatar Nov 19 '15 00:11 stubailo

Oh wow don't remember that one anymore. :)

aldeed avatar Nov 19 '15 01:11 aldeed