Help with file uploads #19
-
Hi, We are using We are building the body in the usual way, creating a variable to hold a If I use a standard Nuxt client-side When comparing the POST requests in the browser, I noticed the $apiParty body is being sent as JSON, so I tried manually setting a "Content-Type": "multipart/form-data" on the request, but then I get an error back from our API stating the form data boundaries are missing. Any advice on how to resolve this issue would be most welcome. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi there! Glad to hear you're using Nuxt API Party in production. I recommend you to read the How It Works section again to get a better understanding about how the Nuxt server route to proxy your request works. In a nutshell: The request has to be serialized for the Having said that, I have added support for Please test again with the latest version. Thanks! |
Beta Was this translation helpful? Give feedback.
Hi there!
Glad to hear you're using Nuxt API Party in production. I recommend you to read the How It Works section again to get a better understanding about how the Nuxt server route to proxy your request works.
In a nutshell: The request has to be serialized for the
/api/__api_party
route. Inside that route, we then construct theFormData
to send to your actual API. Thus, addingmultipart/form-data
asContent-Type
won't have any effect, since a JSON object is expected by/api/__api_party
.Having said that, I have added support for
name
if the Blob is indeed of typeFile
: 6d20ca4#diff-16671b8e02b11955397ac6e8f00650f5dd3e959171b89942e20c9e6372f06776Please test again with the latest versio…