-
Notifications
You must be signed in to change notification settings - Fork 81
FormData in POST is treated as JSON #72
Comments
Hi, Have you tried to set the correct |
Yes, if I set the correct content type header the server complains about missing boundaries. I have spent some hours reading about and debugging this, and in this case the trick is to let the browser handle everything (setting So, for |
You can use a |
The requestInterceptor seems to be tiggered too late in the game.
The correct content type doesn't get set by the browser. |
Any solution for this? |
waiting the solution too |
I've had a similar problem but I do not experience the same issues @bep has.
And experienced no other issues thus far. PM5544 |
@PM5544 so, you pass the data as json object? |
@sohibul To restfull.js yes and then it gets reformatted by the interceptor to the url-parameter format the backend expects when receiving multipart/form-data. |
@PM5544 the main point of this issue is to make sure it is handled natively and effectively as a multiform formdata stream by the browser. It should be a simple conditional fix to this library. |
@bep yes i understand your point. the reason of my reply was to give others with similar issues a way to work around it until a long term solution was formed, if @RobinBressan sees the need to. |
@PM5544 do you have tried to send file object? I need |
@sohibul nope I have not, but I assume it's better left up to the browser to directly connect to an upload service on the backend by using a standard form with an input with type="file". |
It should be
multipart/form-data
with content-type and boundaries set by the browser.Doing a
fetch
POST with the same form object works:See #46
The text was updated successfully, but these errors were encountered: