Endpoint
var bodyParser = require('body-parser')
var app = express()
app.use(bodyParser.json())
app.use(function (req, res) {
data = req.body
Source code (/jshttp/type-is/index.js)
function mimeMatch (expected, actual) {
...
var actualParts = actual.split('/')
var expectedParts = expected.split('/')
...
if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) {
return false
}
...
if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) {
return false
}
JSON Content-Type
Strict parsing by default
application/json