Endpoint with image file on browser #1502
|
I use msw for browser, latest version. type Picture = {
file: File;
};
rest.put<NewPicture, PathParams<string>, Picture>(
"/picture",
async (req, res, ctx) => {
const { file } = req.body;
console.log(file); // mismatch from client
....
}
)There is way to mock uploading images? |
Replies: 1 comment 1 reply
|
Hey, @dro-sh. I believe there are some issues with how MSW handles form data at the moment. I'm addressing most of the known issues in #1436 that's going to be released sometime next year. I highly encourage you to migrate to the Beta version and give it a try today. See #1464 for more details. That version has the correct Thanks for understanding. |
Hey, @dro-sh.
I believe there are some issues with how MSW handles form data at the moment. I'm addressing most of the known issues in #1436 that's going to be released sometime next year. I highly encourage you to migrate to the Beta version and give it a try today. See #1464 for more details. That version has the correct
FormDatahandling, which should allow you to mock form uploads as an example.Thanks for understanding.