Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vizaizai/easy-http-spring
easy-http for spring
https://github.com/vizaizai/easy-http-spring
easy-http http-client spring springboot
Last synced: 18 days ago
JSON representation
easy-http for spring
- Host: GitHub
- URL: https://github.com/vizaizai/easy-http-spring
- Owner: vizaizai
- License: apache-2.0
- Created: 2020-08-01T12:23:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-06T04:52:13.000Z (over 2 years ago)
- Last Synced: 2024-10-22T10:59:03.248Z (26 days ago)
- Topics: easy-http, http-client, spring, springboot
- Language: Java
- Homepage:
- Size: 123 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#### easy-http
##### 快速开始
> easy-http-boot-starter 是easy-http的springBoot版本,使用更简单,并且支持接口级别的拦截器和解码器
##### 1. 版本说明
| 项目 | easy-http-spring | spring-boot |
| ---- | -------------- | ----------- |
| 版本 | 1.1.X | 2.1.X+ |
| 版本 | 1.7.X | 2.2.X+ |##### 2. 安装
``` xml
com.github.vizaizai
easy-http-boot-starter
1.7.0```
普通版请移步: [easy-http](https://github.com/vizaizai/easy-http)
##### 3. 开始
3.1 配置
开启:启动类或者配置上注解`@EnableEasyHttp` value是包路径,默认是被注解包的路径。
``` yaml
easy-http:
base-endpoint: http://127.0.0.1:8080
#base-endpoints: #按客户端名字定义请求地址。如@EasyHttpClient(value = "book"),这个接口将使用127.0.0.1:8888
# book: http://127.0.0.1:8888
retry:
enable: true #是否开启重试
max-attempts: 1
interval-time: 0
request-log: false #是否开启请求日志
```3.2 编写接口
``` java
@EasyHttpClient
public interface BookHttpService {
@Get("/books/{id}")
ApiResult getBookById(@Var("id") String id);
}
```3.3 注入使用
``` java
@Autowired
private BookHttpService bookHttpService;
```##### 4. 核心用法
请移步: [easy-http](https://github.com/vizaizai/easy-http)#### 联系作者
如您有好的建议,或者有任何疑问,可联系我
- QQ: 274550900
- Email: [email protected]