SSR req.body is undefined



  • I have tried to create a post request to server by axios

    this.$axios
    .post(’/set_info’, {

    })
    .then(response => {

    })
    .catch(error => console.log(‘Error’, error.message))

    But I could not to get posted data from the request. Here is my server side:
    app.post(’/set_info’, function (req, res) {
    console.log(req.body)
    res.send(‘OK’)
    })

    Can anyone help me, please ?


Log in to reply