{"id":36055,"date":"2025-05-07T15:51:57","date_gmt":"2025-05-07T07:51:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/36055.html"},"modified":"2025-05-07T15:51:57","modified_gmt":"2025-05-07T07:51:57","slug":"okhttp-%e7%9a%84%e8%af%81%e4%b9%a6%e8%ae%be%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/36055.html","title":{"rendered":"OkHttp \u7684\u8bc1\u4e66\u8bbe\u7f6e"},"content":{"rendered":"<p>\u5728 Android \u5f00\u53d1\u4e2d&#xff0c;\u901a\u8fc7 OkHttp \u81ea\u5b9a\u4e49\u00a0SSLSocketFactory\u00a0\u548c\u00a0X509TrustManager\u00a0\u53ef\u4ee5\u6709\u6548\u589e\u5f3a HTTPS \u901a\u4fe1\u7684\u5b89\u5168\u6027&#xff0c;\u9632\u6b62\u4e2d\u95f4\u4eba\u653b\u51fb&#xff08;\u5982\u6293\u5305\u5de5\u5177 Charles\/Fiddler \u7684\u62e6\u622a&#xff09;\u3002\u4ee5\u4e0b\u662f\u5b9e\u73b0\u9632\u6293\u5305\u7684\u5173\u952e\u6280\u672f\u65b9\u6848&#xff1a;<\/p>\n<p>\u4e00\u3001Okhttp\u8bbe\u7f6e\u56fa\u5b9a\u8bc1\u4e66&#xff08;\u63a8\u8350&#xff09;<\/p>\n<p>OkHttp \u5185\u7f6e\u4e86\u8bc1\u4e66\u56fa\u5b9a\u529f\u80fd&#xff0c;\u65e0\u9700\u81ea\u5b9a\u4e49\u00a0SSLSocketFactory&#xff0c;\u76f4\u63a5\u914d\u7f6e\u5373\u53ef<\/p>\n<p>         val certificatePinner &#061; CertificatePinner.Builder()<br \/>\n                .add(&#034;example.com:443&#034;, &#034;sha256\/&#043;o&#043;LjQ5sWk3ABG4Gl7yZib6xTZ6F7OQ09qW7P9G&#043;Z\/Y&#061;&#034;)<br \/>\n                .build()<br \/>\n         httpClient.certificatePinner(certificatePinner) <\/p>\n<p>1\u3001<span style=\"color:#1c7331\">example.com:\u00a0<\/span>OpenSSL \u8981\u8fde\u63a5\u7684\u00a0HTTPS \u670d\u52a1\u57df\u540d&#xff0c;<span style=\"color:#fe2c24\">\u4f60\u9700\u8981\u66ff\u6362\u4e3a\u5b9e\u9645\u7684\u76ee\u6807\u57df\u540d<\/span><\/p>\n<p>2\u3001<span style=\"color:#1c7331\">443:\u00a0<\/span>\u662f HTTPS \u534f\u8bae\u7684\u9ed8\u8ba4\u7aef\u53e3\u53f7&#xff0c;\u82e5\u670d\u52a1\u5668 HTTPS \u7aef\u53e3\u81ea\u5df1\u8bbe\u7f6e\u7684&#xff0c;\u5219\u9700\u8981\u4fee\u6539<\/p>\n<p>3\u3001<span style=\"color:#1c7331\">sha256\/******<\/span>:\u00a0OpenSSL \u83b7\u53d6\u5230\u7684\u8bc1\u4e66<\/p>\n<p>1\u3001\u83b7\u53d6\u8bc1\u4e66&#xff08;\u670d\u52a1\u5668\u8bc1\u4e66\u7684\u516c\u94a5 SHA256 \u54c8\u5e0c\u503c&#xff09;<\/p>\n<p>\u00a0\u5728\u7ec8\u7aef\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u83b7\u53d6\u8bc1\u4e66<\/p>\n<p>openssl s_client -connect example.com:443 | openssl x509 -pubkey | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 <\/p>\n<li>\n<p>\u8fde\u63a5\u5230\u670d\u52a1\u5668&#xff1a;openssl s_client -connect example.com:443\u00a0\u5efa\u7acb\u4e0e\u76ee\u6807\u670d\u52a1\u5668\u7684 SSL \u8fde\u63a5\u3002<span style=\"color:#fe2c24\">\u6ce8\u610f\u26a0\ufe0f&#xff1a;example.com:443\u00a0\u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u8981\u8fde\u63a5\u7684\u670d\u52a1\u5668\u5730\u5740\u548c\u7aef\u53e3<\/span><\/p>\n<\/li>\n<li>\n<p>\u63d0\u53d6\u8bc1\u4e66&#xff1a;openssl x509 -pubkey\u00a0\u4ece\u8fde\u63a5\u4e2d\u63d0\u53d6\u8bc1\u4e66\u7684\u516c\u94a5\u90e8\u5206\u3002<\/p>\n<\/li>\n<li>\n<p>\u8f6c\u6362\u683c\u5f0f&#xff1a;openssl pkey -pubin -outform der\u00a0\u5c06\u516c\u94a5\u8f6c\u6362\u4e3a DER \u683c\u5f0f&#xff08;\u4e8c\u8fdb\u5236&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u8ba1\u7b97\u54c8\u5e0c&#xff1a;openssl dgst -sha256 -binary\u00a0\u8ba1\u7b97 DER \u683c\u5f0f\u516c\u94a5\u7684 SHA256 \u54c8\u5e0c\u3002<\/p>\n<\/li>\n<li>\n<p>Base64 \u7f16\u7801&#xff1a;openssl enc -base64\u00a0\u5c06\u4e8c\u8fdb\u5236\u54c8\u5e0c\u503c\u8f6c\u6362\u4e3a Base64 \u5b57\u7b26\u4e32\u3002<\/p>\n<\/li>\n<p>\u4e8c\u3001\u81ea\u5b9a\u4e49 SSLSocketFactory &#043; X509TrustManager<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5982\u679c\u9700\u8981\u66f4\u7ec6\u7c92\u5ea6\u7684\u63a7\u5236&#xff08;\u5982\u4ec5\u4fe1\u4efb\u7279\u5b9a\u8bc1\u4e66&#xff09;<\/p>\n<h5>1. \u521b\u5efa\u81ea\u5b9a\u4e49 TrustManager<\/h5>\n<p>class CustomTrustManager : X509TrustManager {<br \/>\n    private val trustedCertificates by lazy { loadTrustedCertificates() }<\/p>\n<p>    private fun loadTrustedCertificates(): List&lt;X509Certificate&gt; {<br \/>\n        \/\/ \u4ece assets \u6216 raw \u76ee\u5f55\u52a0\u8f7d\u8bc1\u4e66&#xff08;\u5982 .crt \u6216 .pem \u6587\u4ef6&#xff09;<br \/>\n        val inputStream &#061; context.assets.open(&#034;certificate.crt&#034;)<br \/>\n        val certificateFactory &#061; CertificateFactory.getInstance(&#034;X.509&#034;)<br \/>\n        return certificateFactory.generateCertificate(inputStream) as X509Certificate<br \/>\n    }<\/p>\n<p>    override fun checkClientTrusted(chain: Array&lt;X509Certificate&gt;, authType: String) {<br \/>\n        \/\/ \u5ba2\u6237\u7aef\u8bc1\u4e66\u9a8c\u8bc1<br \/>\n        throw CertificateException(&#034;Client certificates not supported!&#034;)<br \/>\n    }<\/p>\n<p>    override fun checkServerTrusted(chain: Array&lt;X509Certificate&gt;, authType: String) {<br \/>\n        \/\/ \u9a8c\u8bc1\u670d\u52a1\u5668\u8bc1\u4e66\u94fe\u662f\u5426\u4e0e\u9884\u7f6e\u8bc1\u4e66\u5339\u914d<br \/>\n        if (!trustedCertificates.contains(chain[0])) {<br \/>\n            throw CertificateException(&#034;Untrusted server certificate!&#034;)<br \/>\n        }<br \/>\n    }<\/p>\n<p>    override fun getAcceptedIssuers(): Array&lt;X509Certificate&gt; &#061; arrayOf()<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a02. \u521b\u5efa\u81ea\u5b9a\u4e49 SSLSocketFactory\u00a0\u00a0\u00a0<\/p>\n<p>class CustomSSLSocketFactory(private val trustManager: X509TrustManager) : SSLSocketFactory() {<br \/>\n        private val sslContext by lazy {<br \/>\n            SSLContext.getInstance(&#034;TLS&#034;).apply {<br \/>\n                init(null, arrayOf(trustManager), SecureRandom())<br \/>\n            }<br \/>\n        }<\/p>\n<p>        override fun createSocket(s: Socket, host: String, port: Int, autoClose: Boolean): Socket {<br \/>\n            return sslContext.socketFactory.createSocket(s, host, port, autoClose)<br \/>\n        }<\/p>\n<p>        \/\/ \u5176\u4ed6\u91cd\u5199\u65b9\u6cd5&#xff08;\u76f4\u63a5\u59d4\u6258\u7ed9 sslContext.socketFactory&#xff09;<br \/>\n        override fun getDefaultCipherSuites(): Array&lt;String&gt; {<br \/>\n            sslContext.socketFactory.defaultCipherSuites<br \/>\n        }<\/p>\n<p>        override fun getSupportedCipherSuites(): Array&lt;String&gt; {<br \/>\n            sslContext.socketFactory.supportedCipherSuites<br \/>\n        }<\/p>\n<p>        override fun createSocket(host: String, port: Int): Socket {<br \/>\n            sslContext.socketFactory.createSocket(host, port)<br \/>\n        }<\/p>\n<p>        override fun createSocket(host: String, port: Int, localHost: InetAddress, localPort: Int): Socket {<br \/>\n            sslContext.socketFactory.createSocket(host, port, localHost, localPort)<br \/>\n        }<\/p>\n<p>        override fun createSocket(address: InetAddress, port: Int): Socket {<br \/>\n            sslContext.socketFactory.createSocket(address, port)<br \/>\n        }<\/p>\n<p>        override fun createSocket(address: InetAddress, port: Int, localAddress: InetAddress, localPort: Int): Socket {<br \/>\n            sslContext.socketFactory.createSocket(address, port, localAddress, localPort)<br \/>\n        }<\/p>\n<p>    } <\/p>\n<h5>3. \u914d\u7f6e OkHttpClient<\/h5>\n<p> val trustManager &#061; CustomTrustManager()<br \/>\n    val sslSocketFactory &#061; CustomSSLSocketFactory(trustManager)<br \/>\n    val okHttpClient &#061;<br \/>\n        OkHttpClient.Builder()<br \/>\n            .sslSocketFactory(sslSocketFactory, trustManager)<br \/>\n            .hostnameVerifier { hostname, session -&gt;<br \/>\n                HttpsURLConnection.getDefaultHostnameVerifier().verify(hostname, session)<br \/>\n            }.build() <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u53ef\u4ee5\u6709\u6548\u589e\u5f3a HTTPS \u901a\u4fe1\u7684\u5b89\u5168\u6027\uff0c\u9632\u6b62\u4e2d\u95f4\u4eba\u653b\u51fb\uff08\u5982\u6293\u5305\u5de5\u5177 Charles\/Fiddler \u7684\u62e6\u622a\uff09\u3002\u662f HTTPS \u534f\u8bae\u7684\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff0c\u82e5\u670d\u52a1\u5668 HTTPS \u7aef\u53e3\u81ea\u5df1\u8bbe\u7f6e\u7684\uff0c\u5219\u9700\u8981\u4fee\u6539\u3002\u5982\u679c\u9700\u8981\u66f4\u7ec6\u7c92\u5ea6\u7684\u63a7\u5236\uff08\u5982\u4ec5\u4fe1\u4efb\u7279\u5b9a\u8bc1\u4e66\uff09OpenSSL \u8981\u8fde\u63a5\u7684 HTTPS \u670d\u52a1\u57df\u540d\uff0c\u8ba1\u7b97 DER \u683c\u5f0f\u516c\u94a5\u7684 SHA256 \u54c8\u5e0c\u3002\uff08\u670d\u52a1\u5668\u8bc1\u4e66\u7684\u516c\u94a5 SHA256 \u54c8\u5e0c\u503c\uff09\u5c06\u516c\u94a5\u8f6c\u6362\u4e3a DER \u683c\u5f0f\uff08\u4e8c\u8fdb\u5236\uff09\u3002\u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u8981\u8fde\u63a5\u7684\u670d\u52a1\u5668\u5730\u5740\u548c\u7aef\u53e3\u3002\u5efa\u7acb\u4e0e\u76ee\u6807\u670d\u52a1\u5668\u7684 SSL \u8fde\u63a5\u3002\u4ece\u8fde\u63a5\u4e2d\u63d0\u53d6\u8bc1\u4e66\u7684\u516c\u94a5\u90e8\u5206\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2390],"topic":[],"class_list":["post-36055","post","type-post","status-publish","format-standard","hentry","category-server","tag-okhttp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>OkHttp \u7684\u8bc1\u4e66\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/36055.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OkHttp \u7684\u8bc1\u4e66\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u53ef\u4ee5\u6709\u6548\u589e\u5f3a HTTPS \u901a\u4fe1\u7684\u5b89\u5168\u6027\uff0c\u9632\u6b62\u4e2d\u95f4\u4eba\u653b\u51fb\uff08\u5982\u6293\u5305\u5de5\u5177 Charles\/Fiddler \u7684\u62e6\u622a\uff09\u3002\u662f HTTPS \u534f\u8bae\u7684\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff0c\u82e5\u670d\u52a1\u5668 HTTPS \u7aef\u53e3\u81ea\u5df1\u8bbe\u7f6e\u7684\uff0c\u5219\u9700\u8981\u4fee\u6539\u3002\u5982\u679c\u9700\u8981\u66f4\u7ec6\u7c92\u5ea6\u7684\u63a7\u5236\uff08\u5982\u4ec5\u4fe1\u4efb\u7279\u5b9a\u8bc1\u4e66\uff09OpenSSL \u8981\u8fde\u63a5\u7684 HTTPS \u670d\u52a1\u57df\u540d\uff0c\u8ba1\u7b97 DER \u683c\u5f0f\u516c\u94a5\u7684 SHA256 \u54c8\u5e0c\u3002\uff08\u670d\u52a1\u5668\u8bc1\u4e66\u7684\u516c\u94a5 SHA256 \u54c8\u5e0c\u503c\uff09\u5c06\u516c\u94a5\u8f6c\u6362\u4e3a DER \u683c\u5f0f\uff08\u4e8c\u8fdb\u5236\uff09\u3002\u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u8981\u8fde\u63a5\u7684\u670d\u52a1\u5668\u5730\u5740\u548c\u7aef\u53e3\u3002\u5efa\u7acb\u4e0e\u76ee\u6807\u670d\u52a1\u5668\u7684 SSL \u8fde\u63a5\u3002\u4ece\u8fde\u63a5\u4e2d\u63d0\u53d6\u8bc1\u4e66\u7684\u516c\u94a5\u90e8\u5206\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/36055.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-07T07:51:57+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36055.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/36055.html\",\"name\":\"OkHttp \u7684\u8bc1\u4e66\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-07T07:51:57+00:00\",\"dateModified\":\"2025-05-07T07:51:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/36055.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/36055.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36055.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OkHttp \u7684\u8bc1\u4e66\u8bbe\u7f6e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OkHttp \u7684\u8bc1\u4e66\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/36055.html","og_locale":"zh_CN","og_type":"article","og_title":"OkHttp \u7684\u8bc1\u4e66\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u53ef\u4ee5\u6709\u6548\u589e\u5f3a HTTPS \u901a\u4fe1\u7684\u5b89\u5168\u6027\uff0c\u9632\u6b62\u4e2d\u95f4\u4eba\u653b\u51fb\uff08\u5982\u6293\u5305\u5de5\u5177 Charles\/Fiddler \u7684\u62e6\u622a\uff09\u3002\u662f HTTPS \u534f\u8bae\u7684\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff0c\u82e5\u670d\u52a1\u5668 HTTPS \u7aef\u53e3\u81ea\u5df1\u8bbe\u7f6e\u7684\uff0c\u5219\u9700\u8981\u4fee\u6539\u3002\u5982\u679c\u9700\u8981\u66f4\u7ec6\u7c92\u5ea6\u7684\u63a7\u5236\uff08\u5982\u4ec5\u4fe1\u4efb\u7279\u5b9a\u8bc1\u4e66\uff09OpenSSL \u8981\u8fde\u63a5\u7684 HTTPS \u670d\u52a1\u57df\u540d\uff0c\u8ba1\u7b97 DER \u683c\u5f0f\u516c\u94a5\u7684 SHA256 \u54c8\u5e0c\u3002\uff08\u670d\u52a1\u5668\u8bc1\u4e66\u7684\u516c\u94a5 SHA256 \u54c8\u5e0c\u503c\uff09\u5c06\u516c\u94a5\u8f6c\u6362\u4e3a DER \u683c\u5f0f\uff08\u4e8c\u8fdb\u5236\uff09\u3002\u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u8981\u8fde\u63a5\u7684\u670d\u52a1\u5668\u5730\u5740\u548c\u7aef\u53e3\u3002\u5efa\u7acb\u4e0e\u76ee\u6807\u670d\u52a1\u5668\u7684 SSL \u8fde\u63a5\u3002\u4ece\u8fde\u63a5\u4e2d\u63d0\u53d6\u8bc1\u4e66\u7684\u516c\u94a5\u90e8\u5206\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/36055.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-07T07:51:57+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/36055.html","url":"https:\/\/www.wsisp.com\/helps\/36055.html","name":"OkHttp \u7684\u8bc1\u4e66\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-07T07:51:57+00:00","dateModified":"2025-05-07T07:51:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/36055.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/36055.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/36055.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"OkHttp \u7684\u8bc1\u4e66\u8bbe\u7f6e"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=36055"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36055\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=36055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=36055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=36055"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=36055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}