What is meteors equivalent of $_REQUEST


#1

I have a IOT device that sends to my app at the route /hooks

I would like to capture the data being saved and store it in a mongodb database

From the php background,i would normally use $data_json = json_encode($_REQUEST);

I am using iron router. How would i get the data that is being posted?.

_ have tried_ this and this

var attributes = this.params.query.attributes;
var id = this.request.query.id;

and none of the two variables contain any data that i am expecting.


#2

This worked

var id = this.request.query.id;

and this must be present

if (Meteor.isServer) {
    Router.onBeforeAction(Iron.Router.bodyParser.urlencoded({
        extended: true
    }));
}