I'm developing a site that receives some URL parameters. When the parameters are sent by HTTP GET I can receive then, example:
Calling the site:
http://localhost:8080/#/Home?status=2
Showing the received the parameters, inside any js function:
console.log(this.$route.query.status)
The GET is working fine.
But when I sent the same parameter using HTTP POST, I don't know how to receive it. I used the postman program to send this.
I tried showing it using the $route.params:
console.log(this.$route.params.status)
But no success.
How to receive HTTP POST parameters on vue.js?
I found this guide at the vuejs site:
But it still needs a getPost function.
EDITMy router/index.js is this:
import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'Root',
component: Home
},
{
path: '/Home',
name: 'Home',
component: Home
}
]
})