-
Notifications
You must be signed in to change notification settings - Fork 2
Home
QuincySx edited this page Sep 7, 2017
·
5 revisions
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.github.QuincySx:AvenueNet:0.1-bate'
}
AvenueNet.init(this)
.withApiHost("http://172.16.133.60:8080/") //配置主机地址
.withHttpLog(true) //是否打印网络请求的Log
.withHttpTimeout(2000) //超时时间
.withHeader("testheader", "ceshi") //添加全局请求头
.withLogger(new MyLogger()) //添加日志打印器
.withVerify(new ApiVerify()) //添加网络请求数据的验证
.withErrorHandle(new ErrorHandle()) //处理全局异常
.withAPITest(true) //是否开启API 测试
.withInterceptors(new ApiTestInterceptor("index", R.raw.index)) //添加API 测试拦截器
.build();