使用json作为参数版本
import ;
import .*;
import ;
import ;
//调用post请求
public static JSONObject callPostAPI(String url, JSONObject header, JSONObject body) {
RestTemplate client = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
(MediaType.APPLICATION_JSON);
//设置其他头信息
Iterator iterator = ();
while(()){
String key = (String) ();
String value = (key);
(key, value);
}
HttpEntity<String> formEntity = new HttpEntity<String>((), headers);
JSONObject json = (url, formEntity, ).getBody();
("json:"+());
return json;
}