nuxt-community / axios-module

Secure and easy axios integration for Nuxt 2
https://axios.nuxtjs.org
MIT License
1.19k stars 245 forks source link

POST without request data #491

Open fabiofdsantos opened 3 years ago

fabiofdsantos commented 3 years ago

@nuxtjs/axios v5.13.1

The following code:

await this.$axios.post('signup/plan', {
    plan: this.order.selected_plan,
})

Results in a POST without request data. Any idea?

Browser: Facebook 314.1.0 OS: Android 10 Device: Samsung SM-A705FN

More details:

config: {
    adapter: [Function: <anonymous>], 
    axios-retry: [Object], 
    baseURL: /api, 
    data: {}, 
    headers: [Object], 
    maxBodyLength: -1, 
    maxContentLength: -1, 
    method: post, 
    onDownloadProgress: [Function: n], 
    onUploadProgress: [Function: n], 
    timeout: 0, 
    transformRequest: [Array], 
    transformResponse: [Array], 
    url: /signup/plan, 
    validateStatus: [Function: validateStatus], 
    xsrfCookieName: XSRF-TOKEN, 
    xsrfHeaderName: X-XSRF-TOKEN
}
benjoomali commented 3 years ago

I'm having the same issue on 5.12.5.

this.$axios.$request is working for me for now:

const url = '/signup/plan'
const params = {
  plan: this.order.selected_plan,
}

await this.$axios.$request({ url, params, method: 'post' })