Axios-module: $axios.$delete body payload is missing

Created on 18 Sep 2020  路  12Comments  路  Source: nuxt-community/axios-module

@nuxtjs/axios version: 5.12.2

Issue:
When trying to call API on delete method, the request body is missing.

Example problematic code:

$axios.$delete('/store/products', {
    data: {
        [
            {
                sku: '1234',
            },
        ],
    },
}

More information:
@nuxtjs/axios 5.12.1 don't have this problem

Most helpful comment

There is a PR (https://github.com/axios/axios/pull/3282) ready. Question is when 0.20.1 will be released.

A solution we found for now is using axios.request({url, data, method: 'delete'});

All 12 comments

+1

I'm experiencing the same problem, looks like the Content-Type: 'application/json' is removed from headers when sending the request. I tried to intercept the request and set the Content-Type header, but without success.

There is a PR (https://github.com/axios/axios/pull/3282) ready. Question is when 0.20.1 will be released.

A solution we found for now is using axios.request({url, data, method: 'delete'});

There is a PR (axios/axios#3282) ready. Question is when 0.20.1 will be released.

A solution we found for now is using axios.request({url, data, method: 'delete'});

this.$axios.$request also works.

Hi,

Axios version 0.21.0 has been released 馃帀 please use that and let us know if that solves your issue.

Thanks

Axios version 0.21.0 has been released tada please use that and let us know if that solves your issue.

The issue is solved in 0.21.0

I made merge request with pkg update #436

@jasonsaayman I've tested Axios 0.21.0 and it fixed the issue, thank you.
But install @nuxtjs/axios 5.12.2 without Axios still give me Axios 0.20.0, so maybe we need to wait for @suruaku 's PR before closing this issue.

But install @nuxtjs/axios 5.12.2 without Axios still give me Axios 0.20.0, so maybe we need to wait for @suruaku 's PR before closing this issue.

It is because how semver works.
See this post or straight from documentation

@suruaku Yeah, I get that

But install @nuxtjs/axios 5.12.2 without Axios still give me Axios 0.20.0, so maybe we need to wait for @suruaku 's PR before closing this issue.

It is because how semver works.
See this post or straight from documentation

Wainting for that! :raised_hands:

Merged by #410 and updated with v5.12.3. Sorry for delay.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

monty086 picture monty086  路  3Comments

simllll picture simllll  路  6Comments

kaboume picture kaboume  路  4Comments

jb-alvarado picture jb-alvarado  路  3Comments

chrislentz picture chrislentz  路  3Comments