Answer the question
In order to leave comments, you need to log in
What does the extended property in the urlencoded method in body-parser do?
I programmed a small server:
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const urlencodedParser = bodyParser.urlencoded({extended: true});
app.get('/message', (request, response) => {
response.sendFile(__dirname + '/message.html')
})
app.post('/message', urlencodedParser, (request, response) => {
if (!request.body) return response.sendStatus(400)
console.log(request.body.name + " написал: " + request.body.message)
response.redirect("/message")
})
app.listen(3000, () => {
console.log('Сервер запущен на порте: 3000')
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question