标签:参数 pos class exchange method get change 导出 target
get 普通请求:
restemplate.getForEntity(url,String.class).getBody();
get 导出请求:
restemplate.getForEntity(url, byte[].class);
put 请求:参数是实体类
HttpEntity<String> entity = new HttpEntity<String>(JSON.toJSON(targetDto).toString(),headers);
RestTemplate restemplate = RestTemplateHttpsUtil.restTemplate();
restemplate.exchange(url, HttpMethod.PUT,entity, Map.class);
post请求:参数是实体类
restemplate.postForEntity(url,targetDto,String.class).getBody();
标签:参数 pos class exchange method get change 导出 target
原文地址:https://www.cnblogs.com/ww25/p/11351539.html