Created
May 15, 2013 19:36
-
-
Save robertklep/5586694 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res) { | |
console.log('Received Q params:', req.query); | |
console.log('Received headers :', req.headers); | |
res.send('OK'); | |
}); | |
app.listen(3012); | |
var restler = require('restler'); | |
restler.get('http://localhost:3012', { | |
query : { username: 'xx', password: 'xx' }, | |
headers : { token: 'ThisIsMyCookie' } | |
}).on('complete', function(response) { | |
console.log('Restler received a response:', response); | |
process.exit(0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment