get-post-data

This method get request post data "in string". May use with native http server and express or other.

Usage no npm install needed!

<script type="module">
  import getPostData from 'https://cdn.skypack.dev/get-post-data';
</script>

README

get-post-data

This method get request post data "in string". May use with native http server and express or other.

Example

const http = require('http'),
    getPostData = require('get-post-data');
    
http.createServer((req, res) => {
    getPostData(req, (error, postBody) => {
        if (error) {
            // handle error
        }
        console.log(postBody); // <-- print postBody in console.
    }):
}).listen(8888);