This works and is tested in MeteorJS> 1.3.x
Add the http package from the meteor add http console
An example of a POST request with sending data items to the server and with custom headers.
HTTP.call('POST', tokenUri, { data: { "type": 'authorization_code', //"client_id": clientId, "code": code, "redirect_uri" : redirectUri, }, headers: { "Access-Control-Allow-Origin" : "*", "Access-Control-Allow-Credentials" : "true", "Access-Control-Allow-Methods" : "GET,HEAD,OPTIONS,POST,PUT", "Access-Control-Allow-Headers" : "Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers", } },function(error, response) { if ( error ) { console.log( error ); } else { console.log( response ); } });
source share