Skip to content

Instantly share code, notes, and snippets.

@spasiu
Created August 28, 2015 15:31
Show Gist options
  • Save spasiu/adcf40b1f435982a8eb3 to your computer and use it in GitHub Desktop.
Save spasiu/adcf40b1f435982a8eb3 to your computer and use it in GitHub Desktop.
Non JWT requests
'use strict';
var request = require('superagent');
request
.post('https://supportkit-staging.herokuapp.com/api/login')
.send({
email: '<EMAIL>',
password: '<PASSWORD>'
})
.end(function(err, res) {
console.log('>', res.headers, err ? err.status : null);
request
.post('<URL>')
.set('Cookie', res.headers['set-cookie'])
.send({
target: '<NGROK URL FOR TEST APP>'
})
.end(function(err, res, body) {
console.log('>>>', res.body, err ? err.status : null, err);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment