更新库后Http响应问题

时间:2012-09-10 13:59:46

标签: android httpresponse google-api-java-client

在我更新到最新的google客户端apis

之后,以下代码会抛出错误
 catch (IOException e) {
                if (e instanceof HttpResponseException) {
                    HttpResponse response = ((HttpResponseException) e)
                            .getResponse();//The error is here
                    int statusCode = response.getStatusCode();

在getResponse上会抛出错误The method getResponse() is undefined for the type HttpResponseException 我已经尝试回滚到以前版本的api但是徒劳无功。

1 个答案:

答案 0 :(得分:0)

此方法为removed in version 1.10Google HTTP Client Library

现在异常有自己的getStatusCode()方法。