fen's avatar
Level 2

sending some dataForm with Vuejs axios, but no data received by laravel

Need help ...

vuejs part:

        let data = new FormData();
            data.append('title', this.form.title);
            data.append('body',this.form.body);
            if(this.uploaed == true){
                data.append('image', image);
            }
            // inspect dataForm on console
            for (var pair of data.entries()) {
                console.log(pair[0]+ ', ' + pair[1]); 
            }
            axios.patch(uri, data).then(function (result) {
                console.log(result);
              }, function (error) {
                console.log(error);
              });

laravel part:

    return request()->get('title');

------------------------------some info in console log

title, Thread and event single image upload body, thread image max width: 800event image max width:800 {data: "", status: 200, statusText: "OK", headers: {…}, config: {…}, …}

so data is sent, but not received....why???

0 likes
3 replies
Cronix's avatar

Not sure if this has to do with it, but you spelled "upload" wrong: if(this.uploaed == true){

fen's avatar
Level 2

fixed the spell mistake, but still empty data received...

Please or to participate in this conversation.