Can I pass the http method via the Vue-Resource parameter?

Asked

Viewed 411 times

0

I am using vuejs and am making the ajax requests via Vue-Resources. With Vue-Resources it is possible to make requests like this:

this.$http.get('/someUrl').then(response => {

// get body data
this.someData = response.body;

}, response => {
  // error callback
});

I need to pass the http method via param something like:

var method = "PATCH"
this.$http(url, data, method)
  • Surely you can pass any value dynamically with Vue-Resources or any other lib. var method = "PATH" is fully valid.

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.