请告诉我如何使用RestTemplate调用以下服务方法。感谢。
@RequestMapping(value = "/file/upload", method = { RequestMethod.GET, RequestMethod.POST })
public String fileUpload(@RequestParam("file") MultipartFile file) { }
答案 0 :(得分: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