网络数据请求

自己用

            String url = getworkSheet(keyword, worksheetCondition, page, pagezise);
            Request.Builder builder_ = new Request.Builder()
                    .url(url)
                    .cacheControl(CacheControl.FORCE_NETWORK)
                    .get();
            Response response_ = null;
            try {
                response_ = HttpUtils.getOkHttpClient().newCall(builder_.build()).execute();
                ResponseBody body = response_.body();
                if (body != null) {
                    String data = body.string();
        System.out.println("===data=" + data);
                }
            } catch (Exception e) {
                System.out.println("===error" + e.getMessage());
            }

猜你喜欢

转载自www.cnblogs.com/wisdomzhang/p/12197984.html
今日推荐