Vue-resource: When i use Vue.http.post, if i want to set data in response, i should place data object in which params?

Created on 16 Jun 2016  路  2Comments  路  Source: pagekit/vue-resource

image
in seconde [data], or in third [options.data] ?
i am confused.

Most helpful comment

Try this. this.object is your Vue Data Object.

this.$http.post('/someurl', this.object).then(function (response) {
    // Success
    console.log(response.data)
},function (response) {
    // Error
    console.log(response.data)
});

All 2 comments

Try this. this.object is your Vue Data Object.

this.$http.post('/someurl', this.object).then(function (response) {
    // Success
    console.log(response.data)
},function (response) {
    // Error
    console.log(response.data)
});

@kayyyy ok.It's run.Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yozman picture yozman  路  6Comments

briward picture briward  路  4Comments

Jigsaw5279 picture Jigsaw5279  路  5Comments

odranoelBR picture odranoelBR  路  6Comments

nivv picture nivv  路  4Comments