0

次のコードは、最新の Google クライアント API に更新した後、エラーをスローしています

 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 にロールバックしようとしたが無駄に終わったというエラーがスローされます。

4

1 に答える 1

0

このメソッドは、Google HTTP クライアント ライブラリのバージョン 1.10 で削除されました

例外には独自のgetStatusCode()メソッドがあります。

于 2012-09-19T19:37:50.527 に答える