Created
September 9, 2015 09:33
-
-
Save geek/5d6d9161d4fcf0e4c42d 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 Http = require('http'); | |
var Fs = require('fs'); | |
var Url = require('url'); | |
var server = Http.createServer(function (req, res) { | |
res.writeHead(200); | |
res.end(); | |
}); | |
server.listen(8080); | |
var uri = Url.parse('http://localhost:8080/'); | |
uri.method = 'post'; | |
var req = Http.request(uri); | |
var stream = Fs.createReadStream(__dirname + '/images/wreck.png'); | |
stream.pipe(req); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment