“Req Body Express” Kode Jawaban

Urlencoded Json Express

var express = require('express')

var app = express()

app.use(express.json()) // for parsing application/json
app.use(express.urlencoded({ extended: true })) // for parsing application/x-www-form-urlencoded

app.post('/profile', function (req, res, next) {
  console.log(req.body)
  res.json(req.body)
})
Healthy Hare

Req Body Express

var bodyParser = require('body-parser')
var app = express()

// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }))

// parse application/json
app.use(bodyParser.json())
Grotesque Gannet

Jawaban yang mirip dengan “Req Body Express”

Pertanyaan yang mirip dengan “Req Body Express”

Lebih banyak jawaban terkait untuk “Req Body Express” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya