码迷,mamicode.com
首页 > 其他好文 > 详细

resttemple远程post调用

时间:2020-05-17 17:44:48      阅读:50      评论:0      收藏:0      [点我收藏+]

标签:post   负载   接收   request   存在   headers   参数   head   pen   

1,尽量使用JsonString作为传输数据(发送与接收)

2,restTemplate方法上@LoadBalance注解存在时,必须配置负载节点。 如未配置,去掉此注解

3,实体参数需重新包装:

     

public HttpEntity<String> getParam(String json){

HttpHeaders requestHeaders = new HttpHeaders();

requestHeaders.setContentType(MediaType.APPLICATION_JSON);

return new HttpEntity<String>(json, requestHeaders);
}

resttemple远程post调用

标签:post   负载   接收   request   存在   headers   参数   head   pen   

原文地址:https://www.cnblogs.com/misted/p/12905840.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!