- 授权协议: MIT
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://gitee.com/dt_flys/forest
- 软件文档: https://gitee.com/dt_flys/forest/blob/master/README.md
软件介绍
项目介绍:
Forest是一个高层的、极简的HTTP调用API框架。
相比于直接使用Httpclient您不再用写一大堆重复的代码了,而是像调用本地方法一样去发送HTTP请求。
项目特点:
-
以Httpclient和OkHttp为后端框架
-
通过调用本地方法的方式去发送Http请求
-
支持灵活的模板表达式
-
支持过滤器来过滤传入的数据
-
基于注解、配置化的方式定义Http请求
-
支持Spring集成:除了基本信息配置,它能自动扫描、注入到你自己的代码中
-
JSON字符串到Java对象的自动化解析
-
XML文本到Java对象的自动化解析
-
JSON、XML或其他类型转换器可以随意扩展和替换
-
可以通过OnSuccess和OnError接口参数实现请求结果的回调
-
配置简单,一般只需要@Request一个注解就能完成绝大多数请求的定义
-
实现了业务逻辑与Http协议之间的解耦
Quick Start
创建一个Interface作为远程调用接口
import org.forest.annotation.Request;
import org.forest.annotation.DataParam;
public interface MyClient {
/**
* 百度短链接API
* @param url
* @return
*/
@Request(
url = "http://dwz.cn/create.php",
type = "post",
dataType = "json"
)
Map getShortUrl(@DataParam("url") String url);
}
调用远程接口
@Autowired
MyClient myClient;
...
Map result = myClient.getShortUrl("https://gitee.com/dt_flys/forest");
Ruby for Rails
David Black / Manning Publications / 2006-05-11 / USD 44.95
What's Inside * How Ruby and Rails work, separately and together * Extensive Ruby language tutorial * Ruby techniques for Rails applications * Explore the Rails framework source code A new level of pr......一起来看看 《Ruby for Rails》 这本书的介绍吧!
