1.添加依赖包 <dependency> <groupId>io.github.openfeign</groupId> <artifactId>feign-core</artifactId> <version>9.6.0</version> </dependency>

2.编写一个接口 public interface MyFeignInterFace {

@RequestLine("GET /call")
public String hello();

} // 注意 GET / 之间要有空格

3 简单的调用 /** * @param args */ public static void main(String[] args) { MyFeignInterFace fg=Feign.builder().target(MyFeignInterFace.class,"http://localhost:8080"); String str=fg.hello(); System.out.println(str); } // 地址为自己开启的项目地址 (GET /调用的链接名)