1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

新闻 okhttp 3.3.1 发布,HTTP+SPDY 客户端开发包 下载

本帖由 漂亮的石头2016-05-30 发布。版面名称:软件资讯

  1. 漂亮的石头

    漂亮的石头 版主 管理成员

    注册:
    2012-02-10
    帖子:
    487,683
    赞:
    47
    okhttp 3.3.1 发布,该版本主要是 Bug 修复,包括:


    • Fix: The plaintext check in HttpLoggingInterceptor incorrectly classified newline characters as control characters. This is fixed.


    • Fix: Don't crash reading non-ASCII characters in HTTP/2 headers or in cached HTTP headers.


    • Fix: Retain the response body when an attempt to open a web socket returns a non-101 response code.

    okhttp 是一个 Java 的 HTTP+SPDY 客户端开发包,同时也支持 Android。

    示例代码:

    OkHttpClient client = new OkHttpClient();

    String get(URL url) throws IOException {
    HttpURLConnection connection = client.open(url);
    InputStream in = null;
    try {
    // Read the response.
    in = connection.getInputStream();
    byte[] response = readFully(in);
    return new String(response, "UTF-8");
    } finally {
    if (in != null) in.close();
    }
    }
    okhttp 3.3.1 发布,HTTP+SPDY 客户端开发包下载地址
     
正在加载...