0

任何人都可以告诉我如何使用 RestTemplate 调用以下服务方法。谢谢。

 @RequestMapping(value = "/file/upload", method = { RequestMethod.GET, RequestMethod.POST })
 public String fileUpload(@RequestParam("file") MultipartFile file) { }
4

1 回答 1

0
  RestTemplate rest = new RestTemplate();
 ResponseEntity<youclass> response= rest.exhange(url(your url to post or get), data(data u r sending to server), yourclass.class);
response.getBody() //response back from the server
于 2014-02-02T01:18:50.517 回答