cloudhead / node-static

rfc 2616 compliant HTTP static-file server module, with built-in caching.
MIT License
2.17k stars 245 forks source link

Post parameters #219

Closed kimaldis closed 4 years ago

kimaldis commented 4 years ago

If request.method is 'POST', how can I pick up the POST parameters?

thanks.

kimaldis commented 4 years ago
    let body = '';
    request.on('data', chunk => {
        body += chunk.toString(); // convert Buffer to string
    });
    request.on('end', () => {
        console.log(body);
    });