Wie die post byte-array über RestTemplate

Ziel: Post-Image mit RestTemplate

Derzeit eine variation dieser

MultiValueMap<String, Object> parts = new
LinkedMultiValueMap<String, Object>();
parts.add("field 1", "value 1");
parts.add("file", new
ClassPathResource("myFile.jpg"));
template.postForLocation("http://example.com/myFileUpload", parts); 

Gibt es alternativen? Entsendung ist ein JSON enthält eine base64-codierte byte [] - array eine gültige alternative?

InformationsquelleAutor lemon | 2011-10-28

Schreibe einen Kommentar