我的休息api是。
@PutMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUEpath="/{referenceNumber}")
public void updateCard(@RequestHeader(value = tenantId) String theTenantId,
@PathVariable String referenceNumber,@RequestParam(value = "card")MultipartFile multipartFile,HttpServletRequest request)
我需要在不浏览文件的情况下检查情况。
我的输入格式是
标题:
租户编号:***
正文 :选择“formdata”(邮递员)、“multipart-formdata”(AdvancedRestClient)
卡:不浏览文件
然后我在Postman中收到以下错误。
{
"timestamp": 1549351840816,
"status": 400,
"error": "Bad Request",
"exception": "org.springframework.web.multipart.support.MissingServletRequestPartException",
"message": "Required request part 'card' is not present",
"path": "/app-1.5.0/1.5/references/34a236d7-9305-402f-959d-8c83d5ededbb"
}
如果我在 AdvancedRest 客户端中尝试使用相同的输入
我得到了不同的错误。
{
"timestamp": 1549352119229,
"status": 415,
"error": "Unsupported Media Type",
"exception": "org.springframework.web.HttpMediaTypeNotSupportedException",
"message": "Content type 'null' not supported",
"path": "/app-1.5.0/1.5/references/34a236d7-9305-402f-959d-8c83d5ededbb"
}
是否有任何不同输出的原因,我可以在不浏览文件的情况下检查 api。