REST API with Javascript client

Hi Team,

Im trying to connect to my ERPNext instance using the REST API with meteorjs. I can authenticate no problem but when I try to query resources im getting permission errors. I figured that its something to do with the cookies. I can now see the cookie in the jar but I cannot figure out how to tell the request (npm request) to use the cookie in the jar for the consequent requests. I can see the data when I console.log and follow a few things I found online, but its not working out.

Has anyone here have experience with this, would greatly appreciate some help.

regards
Hemant

Probably for posterity.

Uhm, not sure if meteor itself can include cookies while sending a request. I believe you can use the parent http method of NPM however.

Take a look at this: