[Vuejs]-Getting data from POST request

0👍

Try posting the data as FromData (so that Content-Type is sent as multipart/form-data).

In VueJS, do this:

var formData = new FormData();
formData.append('description', this.description);

this.$http.post('/profile/edit', formData)
    .then(response => {
        console.log(response);
    }, reason => {
        console.log(reason);
    });

Make sure in Dev Tools -> Network you see the sent data as Form Data (not as Request Payload ).

On server do var_dump( $request->request->all() ) and see what request contains.

Leave a comment