0👍
Try out to restructure the request like :
event.preventDefault();
let formData = new FormData();
formData.append("ImageData.File", this.selectedFile);
let config = {
headers: {
"Content-Type": "multipart/form-data"
}
};
axios({
baseURL: 'https://some-domain.com/api/', // your backend base url
method: 'post',
url:'/api/Image',
data:formData,
...config
}).then(resposne => resposne.json())
- [Vuejs]-'Watching` localStorage for a change
- [Vuejs]-Auth0 and Nuxt JS 400 ( Unable to fetch script source ) error when logging in
0👍
I was wrapping the formData and config in an object. They should be the second and third arguments passed to post, like this:
axios.post('/api/Image', formData, config)
And the problem is solved!
- [Vuejs]-Dynamically create html table from an Array
- [Vuejs]-On mouseover show only current card hover effect
Source:stackexchange.com