new MockMultipartFile()的contentType
时间: 2023-11-07 15:16:39 浏览: 245
new MockMultipartFile()的contentType可以通过设置第三个参数来指定。根据引用中的代码示例,可以看到在创建MockMultipartFile对象时,第三个参数是通过调用ContentType.APPLICATION_OCTET_STREAM.toString()来获取的。因此,contentType将被设置为"application/octet-stream"。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [java将File转换为MultipartFile的两种方法](https://blog.csdn.net/weixin_70280523/article/details/128181851)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [File与MultipartFile互转](https://blog.csdn.net/burmem/article/details/102505431)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文