Ich habe eine Anwendung, die Multipart-Anfrage im unteren Format behandelt.Multi-Part-Anfrage
POST .... HTTP/1.1
. . .
Accept:multipart/form-data
...
---boundary123 Content-type:application/octet-stream content-Disposition:
form-data filenale="payload.txt" name="someuniquename"
...
[paylaod content](this is in xml format)
---boundary123 content-type:application/json content-Disposition:form-data
name="someuniquname1"
{
...
ID:"999"
}
--- boundary123
und hier ist mein mein Controller Teil.
@Restcontroller
Class A{
@RequestMapping(value = "https://stackoverflow.com/a/b/c", method = RequestMethod.POST, consumes=
MediaType.MULTIPART_FORM_DATA_VALUE,
produces=MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody static void MyController(@RequestParam("file")
List<MultipartFile> files) {
}
Ist das Controller beiden Teile durch die Identifizierung Content-Type (xml und json, keine Ordnung), wenn ich mehrteilige file.If einzigen analysieren kann nicht empfange Können Sie Format des Controller für das gleiche.
Was enthält Anfrage und Antwort? – phalco
Vielen Dank für Ihre Hilfe, Response-Parameter ist in meinem Fall nicht erforderlich. – phalco