Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.