Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bodyparser

var express = require('express')var bodyParser = require('body-parser') var app = express() // parse application/x-www-form-urlencodedapp.use(bodyParser.urlencoded({ extended: false })) // parse application/jsonapp.use(bodyParser.json()) app.use(function (req, res) {  res.setHeader('Content-Type', 'text/plain')  res.write('you posted:
')  res.end(JSON.stringify(req.body, null, 2))})
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #bodyparser
ADD COMMENT
Topic
Name
9+5 =