首页 > 解决方案 > Okhttpclient 得到错误响应

问题描述

我在其页面源中声明显示 97 的 url...根据我的代码,我得到 85 作为我的输出()..请帮助我

    OkHttpClient client = new OkHttpClient();
    request = new Request.Builder().url(url).build();

    client.newCall(request).enqueue(new Callback() {
        @Override
        public void onFailure(Call call, IOException e) {
            System.out.print("Account Setup Failed");
        }

        @Override
        public void onResponse(Call call, Response response) throws IOException {
            final String myR = response.body().string();

            LoginPage.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    MySystem.visitor = Integer.parseInt(myR.toString());
                }
            });
        }
    });

标签: java

解决方案


推荐阅读