Spring RestTemplate 访问 restFul 接口
程序员文章站
2022-06-26 12:04:12
...
Get:
RestTemplate restTemplate = new RestTemplate();
Map<String, String> urlVariables = new HashMap<String, String>();
urlVariables.put("userId","171348179");
ResponseFormat responseFormat =
restTemplate.getForObject("http://act.dianping.com/customized/wallet517?userId={userId}",ResponseFormat.class,urlVariables);
Post:
差不多