Java项目中调用第三方接口的方式有: https://blog.csdn.net/riemann_/article/details/90539829 接口 restful类型接口
接口工具类
package com.landray.kmss.km.imeeting.util; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.web.client.RestTemplate; import java.util.Map; /** * 会议接口工具 * SpringBoot-RestTemplate方式调用第三方http接口的方式 * * @author CRJ */ public class BusInterfaceUtil { public static String url="http://bkpaas4.aac.com/api/c/self-service-api/create_meeting_webex_version_test/"; /** * 会议接口地址 */ /** * 调用总线接口服务 * * @param url * * @param map * 请求报文 * @return 响应报文 */ public static String sendPost(String url, Map map){ // 定义header对象 HttpHeaders headers = new HttpHeaders(); // 定义http请求实体对象 HttpEntity< Map<String,Object> > entity = new HttpEntity< Map<String,Object>>(map,headers); // 发送请求 RestTemplate template = new RestTemplate(); ResponseEntity<Map> exchange = template.exchange(url, HttpMethod.POST, entity, Map.class); return exchange.getBody().toString(); } }