diff --git a/README.md b/README.md index 95ae020..b9addd4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ okhttp wrapper ###Gradle: ```gradle - compile 'im.wangchao:mhttp:1.2.2' + compile 'im.wangchao:mhttp:1.2.3' ``` ###PROGUARD ProGuard rules now ship inside of the library and are included automatically. diff --git a/mhttp/gradle.properties b/mhttp/gradle.properties index 195f73a..4532c9d 100644 --- a/mhttp/gradle.properties +++ b/mhttp/gradle.properties @@ -17,7 +17,7 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true PROJ_GROUP=im.wangchao -PROJ_VERSION=1.2.2 +PROJ_VERSION=1.2.3 PROJ_NAME=mhttp PROJ_WEBSITEURL=http://wangchao.im/2015/11/22/mhttpadapter-post.html PROJ_ISSUETRACKERURL=https://github.com/motcwang/MHttp/issues diff --git a/mhttp/src/main/java/im/wangchao/mhttp/AbsCallbackHandler.java b/mhttp/src/main/java/im/wangchao/mhttp/AbsCallbackHandler.java index 5cc6677..2c41b5e 100644 --- a/mhttp/src/main/java/im/wangchao/mhttp/AbsCallbackHandler.java +++ b/mhttp/src/main/java/im/wangchao/mhttp/AbsCallbackHandler.java @@ -14,6 +14,7 @@ import im.wangchao.mhttp.internal.exception.ParserException; import im.wangchao.mhttp.internal.exception.ResponseFailException; import okhttp3.Call; +import okhttp3.Protocol; import okhttp3.Response; /** @@ -67,7 +68,12 @@ protected void onFinish(){} OkRequest requestRef = request; OkResponse okResponse = MResponse.builder() - .response(new Response.Builder().code(AbsCallbackHandler.IO_EXCEPTION_CODE).message(e.getMessage()).build()) + .response(new Response.Builder() + .request(requestRef.request()) + .protocol(Protocol.HTTP_1_1) + .code(AbsCallbackHandler.IO_EXCEPTION_CODE) + .message(e.getMessage()) + .build()) .request(requestRef) .builder(); sendFailureMessage(okResponse, e);