Skip to content

Commit

Permalink
去掉http json合法性验证
Browse files Browse the repository at this point in the history
  • Loading branch information
pengjianbo committed Dec 15, 2015
1 parent e5bb67d commit 8e1d1a1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import android.os.AsyncTask;
import android.text.TextUtils;
import cn.finalteam.toolsfinal.JsonFormatUtils;
import cn.finalteam.toolsfinal.JsonValidator;
import cn.finalteam.toolsfinal.Logger;
import cn.finalteam.toolsfinal.StringUtils;
import com.alibaba.fastjson.JSON;
Expand Down Expand Up @@ -251,7 +250,7 @@ private void parseResponseBody(String result, BaseHttpRequestCallback callback)
return;
}

if (StringUtils.isEmpty(result) || !new JsonValidator().validate(result)) {
if (StringUtils.isEmpty(result)) {
callback.onFailure(BaseHttpRequestCallback.ERROR_RESPONSE_NULL, "result empty");
return;
}
Expand All @@ -267,6 +266,7 @@ private void parseResponseBody(String result, BaseHttpRequestCallback callback)
Logger.e(e);
}
} else {

try {
Object obj = JSON.parseObject(result, callback.mType);
//Object obj = gson.fromJson(result, callback.mType);
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
下载这个[JAR](https://github.com/pengjianbo/OkHttpFinal/tree/master/downloads) 或者通过Gradle抓取:

```gradle
compile 'cn.finalteam:okhttpfinal:1.2.1'
compile 'cn.finalteam:okhttpfinal:1.2.2'
#带下载管理
compile 'cn.finalteam:okhttpfinal-dm:1.2.1'
compile 'cn.finalteam:okhttpfinal-dm:1.2.2'
```
**注意:**

如果编译的时候出现 ![](images/error_build.png)这样的错误,请在你项目的build.gralde中加上以下语句
* 1、OkHttpFinal内部使用的是fastjson android版本,如果开发者是本身已经使用了fastjson web版,建议开发者统一使用fastjson android版本
* 如果编译的时候出现 ![](images/error_build.png)这样的错误,请在你项目的build.gralde中加上以下语句

```xml
android {
Expand Down Expand Up @@ -332,6 +334,12 @@ DownloadManager.getInstance(this).setGlobalDownloadListener(new DownloadListener
```

#更新日志
## V1.2.2
* 去掉json合法性验证

## V1.2.1
* fastjson gradle引入

## V1.2.0
* 添加PUT,DELETE,HEAD,PATCH谓词
* 支持http cancel
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ project_artifactId=okhttpfinal
#包类型,Android库是aar
project_packaging=aar
#项目版本
project_version=1.2.1
project_version=1.2.2
#项目官方网站的地址,没有的话就用Github上的地址
project_siteUrl=https://github.com/pengjianbo/OkHttpFinal
#项目的Git地址
Expand Down

0 comments on commit 8e1d1a1

Please sign in to comment.