Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix axios.delete ignores config.data #3282

Merged
merged 2 commits into from Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/core/Axios.js
Expand Up @@ -75,7 +75,8 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
Axios.prototype[method] = function(url, config) {
return this.request(mergeConfig(config || {}, {
method: method,
url: url
url: url,
data: (config || {}).data
}));
};
});
Expand Down
11 changes: 11 additions & 0 deletions test/specs/requests.spec.js
Expand Up @@ -43,6 +43,17 @@ describe('requests', function () {
});
});

it('should allow data', function (done) {
axios.delete('/foo', {
data: { foo: 'bar' }
});

getAjaxRequest().then(function (request) {
expect(request.params).toBe(JSON.stringify({ foo: 'bar' }));
done();
});
});

it('should make an http request', function (done) {
axios('/foo');

Expand Down