String param = '[1424,2255]';
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> request = new HttpEntity<String>(param, headers);
ResponseEntity<String> str = restTemplate.postForEntity(url,request,String.class);
log.debug("End request interface, the response is {}",str);
String json = str.getBody();
相关文章
- 04-10Springboot使用RestTemplate发送Post请求postForEntity (application/json)
- 04-10Springboot使用RestTemplate发送Post请求postForEntity (application/json)的坑
- 04-10postman使用教程2-发 post 请求(application/json和application/x-www-from-urlencoded)
- 04-10使用postman工具做接口测试(六)post 请求(application/json和application/x-www-from-urlencoded)
- 04-10postman使用教程2-发 post 请求(application/json和application/x-www-from-urlencoded)
- 04-10使用HttpClient发送post请求时传递json格式的参数
- 04-10使用Postman发送post的json请求
- 04-10form-data与raw-application/json方式发送POST请求对POJO封装的影响
- 04-10PHP用CURL发送Content-type为application/json的POST请求方法
- 04-10java发送application/json格式的post请求,需要登陆