Answers for "express post item req"

0

get post request content express

const express = require('express');
const bodyParser = require('body-parser');

const app = express();
app.post('/', (req, res) => {
    console.log('Got body:', req.body);
    res.sendStatus(200);
});

app.listen(8080, () => console.log(`Started server at http://localhost:8080!`));
Posted by: Guest on April-29-2021
0

express post method

fetch('',{
	method:'POST',
  	headers:{
    	'content-type': 'application/json'
    },
  	body:JSON.stringify(users)
})
.then(res=> res.json())
.then(data => console.log(data))
Posted by: Guest on October-26-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language