Support for multipart requests
Closed this issue · 2 comments
SimonStefan commented
Hi @f-lopes ,
it is very common to send files together with a form. It would be nice to add full support for multipart requests or at least set some methods to public so that the main functionality can be accessed.
Kind regards,
Stefan
SimonStefan commented
After a fork I realized a method to allow multipart requests with the current version. I'd like to share it for others as a reference:
MockHttpServletRequestBuilder multipart = MockMvcRequestBuilders.multipart("/path")
.file(multipartFile)
.with(MockMvcRequestBuilderUtils.form(form));
f-lopes commented
Hi @SimonStefan,
I am glad you found a solution, and thank you for sharing it!