android okhttp的使用

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

        try {
            Response response = client.newCall(request).execute();
            return response.body().toString();
        } catch (IOException e) {
            e.printStackTrace();
        }

 

posted @ 2018-08-02 23:22  chenzquan  阅读(143)  评论(0编辑  收藏  举报