在我更新到最新的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但是徒劳无功。
答案 0 :(得分:0)
此方法为removed in version 1.10的Google HTTP Client Library。
现在异常有自己的getStatusCode()
方法。