redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

Can't change the headers for the request

Open s4d-prince opened this issue 3 years ago • 1 comments

For all of my requests Content-Type is application/json even if I change it manually with prepareHeaders: (headers) => {headers.set("Content-Type", "multipart/forn-data"); return headers;}. When I try to send the data that contains files I get an error: fields can't be undefined. For my node.js server I'm using multer to upload images and multer only accept multipart/form-data

s4d-prince avatar Jul 17 '22 16:07 s4d-prince

Can you share some code of what you are doing, preferrable a working CodeSandbox?

phryneas avatar Jul 17 '22 20:07 phryneas