[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-844":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},844,"okhttp","square\u002Fokhttp","square","Square’s meticulous HTTP client for the JVM, Android, and GraalVM.","https:\u002F\u002Fsquare.github.io\u002Fokhttp\u002F",null,"Kotlin",46970,9275,1616,77,0,5,32,3,45,"Apache License 2.0",false,"master",true,[26,27,28,29],"android","graalvm","java","kotlin","2026-06-12 02:00:19","OkHttp\n======\n\nSee the [project website][okhttp] for documentation and APIs.\n\nHTTP is the way modern applications network. It’s how we exchange data & media. Doing HTTP\nefficiently makes your stuff load faster and saves bandwidth.\n\nOkHttp is an HTTP client that’s efficient by default:\n\n * HTTP\u002F2 support allows all requests to the same host to share a socket.\n * Connection pooling reduces request latency (if HTTP\u002F2 isn’t available).\n * Transparent GZIP shrinks download sizes.\n * Response caching avoids the network completely for repeat requests.\n\nOkHttp perseveres when the network is troublesome: it will silently recover from common connection\nproblems. If your service has multiple IP addresses, OkHttp will attempt alternate addresses if the\nfirst connect fails. This is necessary for IPv4+IPv6 and services hosted in redundant data\ncenters. OkHttp supports modern TLS features (TLS 1.3, ALPN, certificate pinning). It can be\nconfigured to fall back for broad connectivity.\n\nUsing OkHttp is easy. Its request\u002Fresponse API is designed with fluent builders and immutability. It\nsupports both synchronous blocking calls and async calls with callbacks.\n\nA well behaved user agent\n-------------------------\n\nOkHttp follows modern HTTP specifications such as\n\n* HTTP Semantics - [RFC 9110](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc9110)\n* HTTP Caching- [RFC 9111](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc9111)\n* HTTP\u002F1.1 - [RFC 9112](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc9112)\n* HTTP\u002F2 - [RFC 9113](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc9113)\n* Websockets - [RFC 6455](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc6455)\n* SSE - [Server-sent events](https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fserver-sent-events.html#server-sent-events)\n\nWhere the spec is ambiguous, OkHttp follows modern user agents such as popular Browsers or common HTTP Libraries.\n\nOkHttp is principled and avoids being overly configurable, especially when such configuration is\nto workaround a buggy server, test invalid scenarios or that contradict the relevant RFC.\nOther HTTP libraries exist that fill that gap allowing extensive customisation including potentially\ninvalid requests.\n\nExample Limitations\n\n* Does not allow GET with a body.\n* Cache is not an interface with alternative implementations.\n\nGet a URL\n---------\n\nThis program downloads a URL and prints its contents as a string. [Full source][get_example].\n\n```java\nOkHttpClient client = new OkHttpClient();\n\nString run(String url) throws IOException {\n  Request request = new Request.Builder()\n      .url(url)\n      .build();\n\n  try (Response response = client.newCall(request).execute()) {\n    return response.body().string();\n  }\n}\n```\n\n\nPost to a Server\n----------------\n\nThis program posts data to a service. [Full source][post_example].\n\n```java\npublic static final MediaType JSON = MediaType.get(\"application\u002Fjson\");\n\nOkHttpClient client = new OkHttpClient();\n\nString post(String url, String json) throws IOException {\n  RequestBody body = RequestBody.create(json, JSON);\n  Request request = new Request.Builder()\n      .url(url)\n      .post(body)\n      .build();\n  try (Response response = client.newCall(request).execute()) {\n    return response.body().string();\n  }\n}\n```\n\nFurther examples are on the [OkHttp Recipes page][recipes].\n\n\nRequirements\n------------\n\nOkHttp works on Android 5.0+ (API level 21+) and Java 8+.\n\nOn Android, OkHttp uses [AndroidX Startup][androidx_startup]. If you disable the initializer in the manifest,\nthen apps are responsible for calling `OkHttp.initialize(applicationContext)` in `Application.onCreate`.\n\nOkHttp depends on [Okio][okio] for high-performance I\u002FO and the [Kotlin standard library][kotlin]. Both are small libraries with strong backward-compatibility.\n\nWe highly recommend you keep OkHttp up-to-date. As with auto-updating web browsers, staying current\nwith HTTPS clients is an important defense against potential security problems. [We\ntrack][tls_history] the dynamic TLS ecosystem and adjust OkHttp to improve connectivity and\nsecurity.\n\nOkHttp uses your platform's built-in TLS implementation. On Java platforms OkHttp also supports\n[Conscrypt][conscrypt], which integrates [BoringSSL](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fboringssl) with Java. OkHttp will use Conscrypt if it is\nthe first security provider:\n\n```java\nSecurity.insertProviderAt(Conscrypt.newProvider(), 1);\n```\n\nThe OkHttp `3.12.x` branch supports Android 2.3+ (API level 9+) and Java 7+. These platforms lack\nsupport for TLS 1.2 and should not be used.\n\n\nReleases\n--------\n\nOur [change log][changelog] has release history.\n\nThe latest release is available on [Maven Central](https:\u002F\u002Fsearch.maven.org\u002Fartifact\u002Fcom.squareup.okhttp3\u002Fokhttp\u002F5.3.0\u002Fjar).\n\n```kotlin\nimplementation(\"com.squareup.okhttp3:okhttp:5.3.0\")\n```\n\nSnapshot builds are [available][snap]. [R8 and ProGuard][r8_proguard] rules are available.\n\nAlso, we have a [bill of materials (BOM)][bom] available to help you keep OkHttp artifacts up to date and be sure about version compatibility.\n\n```kotlin\n    dependencies {\n       \u002F\u002F define a BOM and its version\n       implementation(platform(\"com.squareup.okhttp3:okhttp-bom:5.3.0\"))\n\n       \u002F\u002F define any required OkHttp artifacts without version\n       implementation(\"com.squareup.okhttp3:okhttp\")\n       implementation(\"com.squareup.okhttp3:logging-interceptor\")\n    }\n```\n\nMaven and JVM Projects\n----------------------\n\nOkHttp is published as a Kotlin Multiplatform project. While Gradle handles this automatically,\nMaven projects must select between `okhttp-jvm` and `okhttp-android`. The `okhttp` artifact will be empty in\nMaven projects.\n\n```xml\n\u003CdependencyManagement>\n  \u003Cdependencies>\n    \u003Cdependency>\n      \u003CgroupId>com.squareup.okhttp3\u003C\u002FgroupId>\n      \u003CartifactId>okhttp-bom\u003C\u002FartifactId>\n      \u003Cversion>5.2.0\u003C\u002Fversion>\n      \u003Ctype>pom\u003C\u002Ftype>\n      \u003Cscope>import\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n  \u003C\u002Fdependencies>\n\u003C\u002FdependencyManagement>\n```\n\n\n\n```xml\n\u003Cdependency>\n  \u003CgroupId>com.squareup.okhttp3\u003C\u002FgroupId>\n  \u003CartifactId>okhttp-jvm\u003C\u002FartifactId>\n  \u003C!-- Remove after OkHttp 5.2.0 with updated BOM. -->\n  \u003Cversion>5.1.0\u003C\u002Fversion>\n\u003C\u002Fdependency>\n\n\u003Cdependency>\n  \u003CgroupId>com.squareup.okhttp3\u003C\u002FgroupId>\n  \u003CartifactId>mockwebserver3\u003C\u002FartifactId>\n\u003C\u002Fdependency>\n\n\u003Cdependency>\n  \u003CgroupId>com.squareup.okhttp3\u003C\u002FgroupId>\n  \u003CartifactId>logging-interceptor\u003C\u002FartifactId>\n\u003C\u002Fdependency>\n```\n\nMockWebServer\n-------------\n\nOkHttp includes a library for testing HTTP, HTTPS, and HTTP\u002F2 clients.\n\nThe latest release is available on [Maven Central](https:\u002F\u002Fsearch.maven.org\u002Fartifact\u002Fcom.squareup.okhttp3\u002Fmockwebserver\u002F5.3.0\u002Fjar).\n\n```kotlin\ntestImplementation(\"com.squareup.okhttp3:mockwebserver3:5.3.0\")\n```\n\nMockWebServer is used for firstly for internal testing, and for basic testing of apps using OkHttp client.\nIt is not a full featured HTTP testing library that is developed standalone. It is not being actively developed\nfor new features. As such you might find your needs outgrow MockWebServer and you may which to use a\nmore full featured testing library such as [MockServer](https:\u002F\u002Fwww.mock-server.com\u002F).\n\nGraalVM Native Image\n--------------------\n\nBuilding your native images with [GraalVM] should work automatically.\n\nSee the okcurl module for an example build.\n\n```shell\n$ .\u002Fgradlew okcurl:nativeImage\n$ .\u002Fokcurl\u002Fbuild\u002Fgraal\u002Fokcurl https:\u002F\u002Fhttpbin.org\u002Fget\n```\n\nJava Modules\n------------\n\nOkHttp (5.2+) implements Java 9 Modules.\n\nWith this in place Java builds should fail if apps attempt to use internal packages.\n\n```\nerror: package okhttp3.internal.platform is not visible\n    okhttp3.internal.platform.Platform.get();\n                    ^\n  (package okhttp3.internal.platform is declared in module okhttp3,\n    which does not export it to module com.bigco.sdk)\n```\n\nThe stable public API is based on the list of defined modules:\n\n- okhttp3\n- okhttp3.brotli\n- okhttp3.coroutines\n- okhttp3.dnsoverhttps\n- okhttp3.java.net.cookiejar\n- okhttp3.logging\n- okhttp3.sse\n- okhttp3.tls\n- okhttp3.urlconnection\n- mockwebserver3\n- mockwebserver3.junit4\n- mockwebserver3.junit5\n\nLicense\n-------\n\n```\nCopyright 2019 Square, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n [GraalVM]: https:\u002F\u002Fwww.graalvm.org\u002F\n [androidx_startup]: https:\u002F\u002Fdeveloper.android.com\u002Fjetpack\u002Fandroidx\u002Freleases\u002Fstartup\n [bom]: https:\u002F\u002Fdocs.gradle.org\u002F6.2\u002Fuserguide\u002Fplatforms.html#sub:bom_import\n [changelog]: https:\u002F\u002Fsquare.github.io\u002Fokhttp\u002Fchangelog\u002F\n [conscrypt]: https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fconscrypt\u002F\n [get_example]: https:\u002F\u002Fraw.github.com\u002Fsquare\u002Fokhttp\u002Fmaster\u002Fsamples\u002Fguide\u002Fsrc\u002Fmain\u002Fjava\u002Fokhttp3\u002Fguide\u002FGetExample.java\n [kotlin]: https:\u002F\u002Fkotlinlang.org\u002F\n [okhttp3_pro]: https:\u002F\u002Fraw.githubusercontent.com\u002Fsquare\u002Fokhttp\u002Fmaster\u002Fokhttp\u002Fsrc\u002Fmain\u002Fresources\u002FMETA-INF\u002Fproguard\u002Fokhttp3.pro\n [okhttp]: https:\u002F\u002Fsquare.github.io\u002Fokhttp\u002F\n [okhttp_312x]: https:\u002F\u002Fgithub.com\u002Fsquare\u002Fokhttp\u002Ftree\u002Fokhttp_3.12.x\n [okio]: https:\u002F\u002Fgithub.com\u002Fsquare\u002Fokio\n [post_example]: https:\u002F\u002Fraw.github.com\u002Fsquare\u002Fokhttp\u002Fmaster\u002Fsamples\u002Fguide\u002Fsrc\u002Fmain\u002Fjava\u002Fokhttp3\u002Fguide\u002FPostExample.java\n [r8_proguard]: https:\u002F\u002Fsquare.github.io\u002Fokhttp\u002Ffeatures\u002Fr8_proguard\u002F\n [recipes]: https:\u002F\u002Fsquare.github.io\u002Fokhttp\u002Frecipes\u002F\n [snap]: https:\u002F\u002Fs01.oss.sonatype.org\u002Fcontent\u002Frepositories\u002Fsnapshots\u002F\n [tls_history]: https:\u002F\u002Fsquare.github.io\u002Fokhttp\u002Ftls_configuration_history\u002F\n","OkHttp 是由 Square 开发的一款适用于 JVM、Android 和 GraalVM 的高效 HTTP 客户端。它支持 HTTP\u002F2，通过共享 socket 和连接池技术来减少请求延迟；透明 GZIP 压缩功能可以减小下载大小；响应缓存机制则避免了重复请求时的网络开销。此外，OkHttp 在面对网络问题时具有良好的恢复能力，支持现代 TLS 特性如 TLS 1.3、ALPN 和证书锁定等。其设计简洁易用，提供同步和异步调用方式。OkHttp 遵循最新的 HTTP 规范，并在规范不明确时参考主流浏览器和其他常见 HTTP 库的行为，这使得它非常适合用于需要稳定性和性能的应用场景中，比如移动应用开发或构建高性能的后端服务。",2,"2026-06-11 02:39:46","top_all"]