public static void main(String[] args) {
HttpHeaders headersPost = new HttpHeaders();
headersPost.add(HttpHeaders.CONTENT_TYPE,"application/x-www-form-urlencoded");
RestTemplate template = new RestTemplate();
//使用占位符
HttpEntity<String> httpEntitPost = new HttpEntity(MessageFormat.format("param0={0}¶m1={1}","test0", "test1"),headersPost);
String crmToken = template.postForObject("http://ip:port/auth/oauth/token", httpEntitPost, String.class);
System.out.println(crmToken);
}