标签:设置 post line media new 使用 header color tty
url=‘http://posturl‘;JSONObject postData = new JSONObject();
postData.put("shopid", 1);
JSONObject json = restTemplate.postForEntity(url, postData, JSONObject.class).getBody();
String url = ‘http://posturl‘;
MultiValueMap<String, String> map= new LinkedMultiValueMap<String, String>();
map.add("shopid","1");
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<MultiValueMap<String, String>>(map, headers);
return restTemplate.postForEntity(url, request,String.class);
String url = ‘http://posturl‘; MultiValueMap<String, String> map= new LinkedMultiValueMap<String, String>(); map.add("shopid","1");
return restTemplate.postForEntity(url, map,String.class);
springboot使用restTemplate post提交值 restTemplate post值
标签:设置 post line media new 使用 header color tty
原文地址:https://www.cnblogs.com/xinweiyun/p/9348273.html