Replies: 1 comment 3 replies
-
Axios doesn't support formData response, but you can try to handle it manually (not tested): const {data} = await axios.get(url, {responseType: 'arraybuffer'});
const formdata = await new Response(data).formData(); |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'd like to use axios in the browser to consume an EP of a service that returns a
multipart/form-data
response with a file and a JSON object.I didn't find any example on the docs and I couldn't make it work. My current attempt is this:
but the Promise contains a string with the raw response instead of an instance of
FormData
.Using
fetch
I'm able to return aFormData
but I'd like to use axios instead since all my codebase depends on axios:Thanks
Beta Was this translation helpful? Give feedback.
All reactions