10

I have the following method in my Vue.JS component:

removeItems (itemsArray) {
    this.$http.delete(this.apiUrl, {items : itemsArray})
    .then((response) => {
       this.msg = response.msg;
    });
}

In vue-resource 0.8.0 everything worked fine. After upgrading to 1.0.3 it doesn't. I found in release notes that they deleted body from GET request, which makes sense, but why did the DELETE request stop working? If they disabled specifying body explicitly in the DELETE request, how do I add it?

0

1 Answer 1

13

Found a solution. Simply add {body:data} to the request:

removeItems (itemsArray) {
  this.$http.delete(this.apiUrl, {body: {items : itemsArray}})
  .then((response) => {
    this.msg = response.msg;
  });
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.