Feign Java HTTP 客户端库

程序名称:Feign

授权协议: Apache

操作系统: 跨平台

开发语言: Java

Feign 介绍

Feign 使得 Java HTTP 客户端编写更方便。

Feign 灵感来源于 Retrofit,
JAXRS-2.0
WebSocket,Feign 最初是为了降低统一绑定 Denominator
到 HTTP APIs 的复杂度,不管是否是 Restful 。

基础使用:

interface GitHub {
  @RequestLine("GET /repos/{owner}/{repo}/contributors")
  List<Contributor> contributors(@Param("owner") String owner, @Param("repo") String repo);
}
static class Contributor {
  String login;
  int contributions;
}
public static void main(String... args) {
  GitHub github = Feign.builder()
                       .decoder(new GsonDecoder())
                       .target(GitHub.class, "https://api.github.com");
  // Fetch and print a list of the contributors to this library.
  List<Contributor> contributors = github.contributors("netflix", "feign");
  for (Contributor contributor : contributors) {
    System.out.println(contributor.login + " (" + contributor.contributions + ")");
  }
}

Feign 官网

https://github.com/Netflix/feign

相关编程语言

提到 EclEmma 首先就要说到著名的 Java 覆盖测试工具...
Solex是一个WEB应用测试用的Eclipse插件。Solex可以...
Apache为我们提供了一个强大的工具 Cactus!它是一套...
Google C Testing Framework是Google公司用来在各种...
JdbcProxy 是 SourceForge 上一个开源的 Java 项目,...
Ripplet是一款负载测试工具,特征如下: 1)基于Apa...