• 网络数据请求


    自己用

    String url = "";
    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());
    }
    
  • 相关阅读:
    RTP/RTSP编程
    makefile
    VS 2010内存泄漏检测
    Linux Shell中捕获CTRL+C
    const
    Hdu 5344
    Hdu5762
    CF1200C
    CF1200B
    CF1200A
  • 原文地址:https://www.cnblogs.com/wisdomzhang/p/12197984.html
Copyright © 2020-2023  润新知