Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(path=="/string") {
- if(request.method == 'POST') {
- console.log("POST");
- var body = '';
- request.on('data', function (data) {
- body += data;
- console.log(body);
- if (body.length > 1e6)
- request.connection.destroy();
- });
- request.on('end', function () {
- console.log(" " + body);
- });
- response.writeHead(200, {'Content-Type': 'text/html'});
- response.end('post received');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement