[Vuejs]-Flask, Axios POST returns a Network error

0👍

Try to call post from the axios and placing {} around data and headers.

     onSubmit () {
        const var path = 'http://127.0.0.1:5000/'
        this.axios.post({
        path,
        {data: {
            file: this.form.file,
            reverb: 'reverb'
        }},
        {headers: {
            'Content-Type': 'text/plain;charset=utf-8'
        }},
    }).then(function (response) {
        console.log(response);
    }).catch(function (error) {
        console.log(error);
    });
}

Leave a comment