Created
March 27, 2016 07:09
-
-
Save adoyle-h/4be2e24b0cc517fd426b to your computer and use it in GitHub Desktop.
This file contains 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 targetUrl = 'https://www.douban.com/'; | |
var body = '<html>' | |
+ '<head></head>' | |
+ '<body>' | |
+ '<form action="' + targetUrl + '" method="POST">' | |
+ '<input type="text" name="hello" value="world"/>' | |
+ '</form>' | |
+ '<script> document.forms[0].submit();</script>' | |
+ '</body>' | |
'</html>'; | |
http.createServer(function (request, response) { | |
response.writeHead(200, {'Content-Type': 'text/html'}); | |
response.write(body); | |
response.end(); | |
}).listen(8888); | |
console.log('访问 http://127.0.0.1:8888/ ,去看 POST 请求是否发送了 cookie!'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment