Asked by: Azat Akmyradov
I am creating an api to upload files. But it works when I upload them through web routes file, but it doesn't work when I upload them through api routes file.
axios.defaults.headers.put['Content-Type'] = 'multipart/form-data';
axios.put('/api/pikirler', formData);
If I change it to:
axios.defaults.headers.post['Content-Type'] = 'multipart/form-data';
axios.post('/upload', formData);
It works fine. But I want to use it in api routes. Thanks in advance.
No comments:
Post a Comment