{"id":294128,"date":"2019-09-01T21:00:17","date_gmt":"2019-09-01T21:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=294128"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=294128","title":{"rendered":"\u041a\u0430\u043a \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c Okhttp \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043b\u0438\u043d\u043e\u0432\u0441\u043a\u0438\u0435 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<ol>\n<li> \u041d\u0430\u0434\u043e \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0432 header\u2019s \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0438 id \u044e\u0437\u0435\u0440\u0430<\/li>\n<li> \u041d\u0430\u0434\u043e \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0442\u044c \u0438\u0437 headers \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0438 id \u044e\u0437\u0435\u0440\u0430<\/li>\n<li> \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c<\/li>\n<\/ol>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u2013 Retrofit. \u0417\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b.<br \/>  \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f, \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c Okhttp client \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u041f\u043e\u043b\u0447\u0430\u0441\u0430 \u0438 \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e, \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0432\u0441\u0435 \u0440\u0430\u0434\u044b. \u041d\u043e \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0430 \u043d\u0435\u043b\u044c\u0437\u044f \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 Okhttp \u043a\u043b\u0438\u0435\u043d\u0442\u0430?<br \/>  <a name=\"habracut\"><\/a> <br \/>  \u041d\u0430\u0447\u043d\u0451\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443. \u0415\u0441\u043b\u0438 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c header \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c (\u043d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c @HeaderMap), \u0442\u043e \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c headers \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435? \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0430\u0434\u043e \u043d\u0430\u0448 \u043e\u0442\u0432\u0435\u0442 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u043a\u043b\u0430\u0441\u0441 Response, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 headers().<\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0431\u044b\u043b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:<\/p>\n<pre><code class=\"kotlin\">@FormUrlEncoded @POST(&quot;someurl\/&quot;) suspend fun request1(@Field(&quot;idLast&quot;) idLastFeed: Long,                      @Field(&quot;autoview&quot;) autoView: Boolean,                      @HeaderMap headers: Map&lt;String, String?&gt;): Answer1 @FormUrlEncoded @POST(&quot;someurl\/&quot;) suspend fun request2(@Field(&quot;ransom&quot;) ransom: Long,                                 @HeaderMap headers: Map&lt;String, String?&gt;): Answer2 <\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0430\u043b:<\/p>\n<pre><code class=\"kotlin\">@FormUrlEncoded @POST(&quot;someurl&quot;) suspend fun request1(@Field(&quot;idLast&quot;) idLastFeed: Long,                      @Field(&quot;autoview&quot;) autoView: Boolean,                      @HeaderMap headers: Map&lt;String, String?&gt;?): Response&lt;Answer1&gt;  @FormUrlEncoded @POST(&quot;someurl&quot;) suspend fun request2(@Field(&quot;ransom&quot;) ransom: Long,                   @HeaderMap headers: Map&lt;String, String?&gt;?): Response&lt;Answer2&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 headersMap. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 RestClient \u0434\u043b\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0432 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0435 \u043d\u0435 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0442\u044c \u0438\u0437 sharedPreferences \u0442\u043e\u043a\u0435\u043d \u0438 id. \u0412\u043e\u0442 \u0442\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f: <\/p>\n<pre><code class=\"kotlin\">class RestClient(private val api: Api, private val prefs: SharedPreferences) {      suspend fun request1(last: Long, autoView: Boolean): Answer1 {         return api.request1(last, autoView, headers())     }      suspend fun request2(id: Long): Answer2 {         return api.request2(id, headers())     }     private val TOKEN_KEY = &quot;Token&quot;     private val ID_KEY = &quot;ID&quot;     fun headers(): Map&lt;String, String&gt; {         return mapOf(             TOKEN_KEY to prefs.getString(Constants.Preferences.SP_TOKEN_KEY, &quot;&quot;),             ID_KEY to prefs.getLong(Constants.Preferences.SP_ID, -1).toString()         )     } }<\/code><\/pre>\n<p>  \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435: <\/p>\n<ol>\n<li> \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/li>\n<li> \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0443 headers.<\/li>\n<li> \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434.<\/li>\n<li> \u0412\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 headers.<\/li>\n<li> \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/li>\n<\/ol>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0430\u043c \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0412\u043c\u0435\u0441\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441 \u0442\u0438\u043f\u043e\u043c @Field, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c @FieldMap. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2013 \u043f\u0435\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044f. \u0412\u0442\u043e\u0440\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0441\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441. \u0417\u0434\u0435\u0441\u044c \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Kotlin DSL (\u043c\u043d\u0435 \u0442\u0430\u043a \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c). \u042f \u0441\u043e\u0437\u0434\u0430\u043b \u043a\u043b\u0430\u0441\u0441 Request, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0434\u0435\u043b\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e send \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:<\/p>\n<pre><code class=\"kotlin\">@FormUrlEncoded @POST(&quot;someurl\/&quot;) suspend fun feedListMap(@FieldMap map: HashMap&lt;String, out Any&gt;?,             @HeaderMap headers: Map&lt;String, String?&gt;?): Response&lt;Answer1&gt;  @FormUrlEncoded @POST(&quot;someurl\/&quot;) suspend fun feedListMap(@FieldMap map: HashMap&lt;String, out Any&gt;?,              @HeaderMap headers: Map&lt;String, String?&gt;?): Response&lt;Answer2&gt; <\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043b\u0430\u0441\u0441 Request:<\/p>\n<pre><code class=\"kotlin\">class Request&lt;T&gt;(     var fieldHashMap: java.util.HashMap&lt;String, out Any&gt; = hashMapOf(),     var headersHashMap: Map&lt;String, String?&gt;? = mapOf(),     var req: suspend (HashMap&lt;String, out Any&gt;?, Map&lt;String, String?&gt;?) -&gt; Response&lt;T&gt;? = { _,_ -&gt; null} ){      fun send(): Response&lt;T&gt;? {         return runBlocking {             try {                 req.invoke(fieldHashMap, headersHashMap)             } catch (e: Exception) {                 throw Exception(e.message ?: &quot;\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430&quot;)             } catch (t: Throwable) {                 throw Exception(t.message ?: &quot;\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430&quot;)             }         }     } }<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u043a\u043b\u0430\u0441\u0441 RestClient \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"kotlin\">class RestClient(private val api: Api, private val prefs: SharedPreferences) {      private val TOKEN_KEY = &quot;Token&quot;     private val ID_KEY = &quot;ID&quot;     fun headers(): Map&lt;String, String&gt; {         return mapOf(             TOKEN_KEY to prefs.getString(Constants.Preferences.SP_TOKEN_KEY, &quot;&quot;),             ID_KEY to prefs.getLong(Constants.Preferences.SP_ID, -1).toString()         )     }      fun &lt;T&gt; buildRequest(request: Request&lt;T&gt;.() -&gt; Unit): T? {         val req = Request&lt;T&gt;()         request(req)         val res = req.send()         val newToken = res?.headers()?.get(TOKEN_KEY)         val newID = res?.headers()?.get(ID_KEY)?.toLong()         if (newToken.notNull() && newID.notNull()) {             prefs.edit()                 .putString(TOKEN_KEY, newToken)                 .putLong(ID_KEY, newID)                 .apply()         }         return res?.body()     }      fun fiedsMapForRequest1(last: Long, autoView: Boolean) = hashMapOf(&quot;idLast&quot; to last, &quot;autoview&quot; to autoView)      fun fiedsMapForRequest2(ransom: Long, autoView: Boolean) = hashMapOf(&quot;ransom&quot; to ransom)  }<\/code><\/pre>\n<p>  \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u043e\u0442 \u0442\u0430\u043a \u043c\u044b \u0432 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b:<\/p>\n<pre><code class=\"kotlin\">try {             val answer1 = restClient.buildRequest&lt;Answer1&gt; {                 fieldHashMap = restClient.fiedsMapForRequest1(1, false)                 headersHashMap = restClient.headers()                 req = api::request1             }            val answer2 = restClient.buildRequest&lt;Answer2&gt; {                 fieldHashMap = restClient.fiedsMapForRequest2(1234)                 headersHashMap = restClient.headers()                 req = api::request2             }             \/\/ do something with answer   } catch (e: Exception) {            viewState.showError(e.message.toString())   } catch (e: InterruptedException) {             viewState.showError(e.message.toString())   } finally {             viewState.hideProgress()   } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043b\u0438\u043d\u0430 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c.<\/p>\n<p>  P.S. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Okhttp \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c.<\/p><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/465781\/\"> https:\/\/habr.com\/ru\/post\/465781\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<ol>\n<li> \u041d\u0430\u0434\u043e \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0432 header\u2019s \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0438 id \u044e\u0437\u0435\u0440\u0430<\/li>\n<li> \u041d\u0430\u0434\u043e \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0442\u044c \u0438\u0437 headers \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0438 id \u044e\u0437\u0435\u0440\u0430<\/li>\n<li> \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c<\/li>\n<\/ol>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u2013 Retrofit. \u0417\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b.<br \/>  \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f, \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c Okhttp client \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u041f\u043e\u043b\u0447\u0430\u0441\u0430 \u0438 \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e, \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0432\u0441\u0435 \u0440\u0430\u0434\u044b. \u041d\u043e \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0430 \u043d\u0435\u043b\u044c\u0437\u044f \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 Okhttp \u043a\u043b\u0438\u0435\u043d\u0442\u0430?  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-294128","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=294128"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294128\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=294128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=294128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=294128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}