Proxy FormData from frontend -> api route -> backend api
Unanswered
English Springer Spaniel posted this in #help-forum
English Springer SpanielOP
Hi,
I am trying to submit FormData from frontend form, into
For some reason, the boundary gets messed up. So i tried to read the request as
What's the best approach to doing this?
I am trying to submit FormData from frontend form, into
/api
route and then take the same data from there and send it to our backend API which is set-up to take multipart/form-dataFor some reason, the boundary gets messed up. So i tried to read the request as
req.arrayBuffer()
and then POST with body: Buffer.from(arrayBuffer)
but Vercel failed with:[TypeError: fetch failed] {
[cause]: TypeError: Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer at ArrayBuffer.slice
}
What's the best approach to doing this?