SpringBoot第18讲:SpringBoot 如何访问外部接口 本文是SpringBoot第18讲,在SpringBoot接口开发中,存在着本模块的代码需要访问外面模块接口或外部url链接的需求, 比如调用外部的地图API或者天气API。那么有哪些方式可以调用外部接口呢? 文章目录 SpringBoot第18讲:SpringBoot 如何访问外部接口 1、什么样的场景需要访问外部接口 2、访问外部接口的常见方案 2.1、方案一: 采用原生的Http请求 2.2、方案二: 采用Feign进行消费 2.3、方案三: 采用RestTemplate方法 (用户中心采用的该方法) 1、Get请求之——getForEntity(String url,Class responseType,Object…urlVariables)