{"id":299172,"date":"2020-02-24T15:00:26","date_gmt":"2020-02-24T15:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=299172"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=299172","title":{"rendered":"OData + RxJava + Retrofit 2 \u0434\u043b\u044f android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489688\/\">\u0421\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043e\u0441\u0435\u043b\u0435 \u043d\u0435 \u0432\u0438\u0434\u0430\u043d\u043d\u043e\u0439. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u043a\u0443\u0440\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>RxJava<\/b> \u0438 <b>Retrofit 2<\/b> \u2014 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 <b>Odata<\/b> \u0434\u043b\u044f android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 <b>Jake Wharton<\/b> \u0437\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h3>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 \u043c\u0438\u0440 \u043c\u0430\u0433\u0438\u0438<\/h3>\n<p>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 <b>Odata<\/b> \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u0440\u0435\u0431\u0430\u0442\u044c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u043f\u0438\u0441\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0422\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043d\u043e \u043d\u0435 \u0442\u0443\u0442 \u0442\u043e \u0431\u044b\u043b\u043e, \u0442\u043e \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e \u043d\u0430 Java \u2014 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442 \u0442\u0430\u043a \u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 android.<\/p>\n<p>  \u0410 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 <b>Odata<\/b> \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 Apache \u2014 Olingo \u0438 Microsoft \u043d\u0430 C#. <\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b <b>Odata<\/b> \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c \u0443 Microsoft \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. <br \/>  <a name=\"habracut\"><\/a> <br \/>  \u0412\u043e\u0442 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441 Wiki <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Open_Data_Protocol\">Open_Data_Protocol<\/a><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Open Data Protocol (OData)<\/b><\/p>\n<div class=\"spoiler_text\">\n<blockquote><p>Open Data Protocol (OData) \u2014 \u044d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0432\u0435\u0431-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 HTTP-\u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 XML \u0438\u043b\u0438 JSON.<\/p>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 4.0, OData \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442, \u043e\u0434\u043e\u0431\u0440\u0435\u043d\u043d\u044b\u0439 OASIS.<\/p><\/blockquote>\n<\/div>\n<\/div>\n<p>  \u0418 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, <b>Odata<\/b> \u2014 \u044d\u0442\u043e \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 SQL \u0432 REST API \u0438 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u043c\u043e\u0435 \u0442\u043e. <\/p>\n<p>  \u041d\u043e \u0443 \u043d\u0430\u0441 \u0441\u0442\u0440\u043e\u0433\u043e \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0438 \u0431\u0435\u0437 \u0437\u043d\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. <\/p>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0438\u043f\u043e\u0432\u044b\u043c \u0438 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432 \u0441\u0435\u0442\u0438.<\/p>\n<p>  \u0421\u043a\u0430\u0436\u0443 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u043a\u0440\u043e\u043c\u0435 \u044d\u0442\u0438\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0432 \u0441\u0435\u0442\u0438 \u2014 \u043f\u043e \u0442\u0435\u043c\u0435 \u0432\u0441\u0435 \u043f\u043b\u043e\u0445\u043e.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u043c\u0430\u0433\u0438\u0435\u0439:<\/p>\n<p>  <b>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043b\u0443\u0436\u0431\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0442\u044c\u044e<\/b><\/p>\n<p>  \u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <b>Retrofit 2<\/b> \u0438 \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 <b>Square<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0432 \u0444\u0430\u0439\u043b build.gradle<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">\/\/ Network     implementation 'com.squareup.retrofit2:retrofit:2.7.1' \/\/ \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0430\u043c Retrofit 2     implementation 'com.squareup.retrofit2:converter-gson:2.7.1' \/\/ \u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JSON      implementation 'com.squareup.okhttp3:logging-interceptor:4.3.1' \/\/ \u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432     implementation 'com.squareup.retrofit2:adapter-rxjava2:2.7.1' \/\/ \u0410\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 RxJava     implementation 'com.squareup.okhttp3:okhttp:4.3.1' \/\/ OkHttp - \u044d\u0442\u043e HTTP-\u043a\u043b\u0438\u0435\u043d\u0442 <\/code><\/pre>\n<p><b>listing 1<\/b><\/div>\n<\/div>\n<p>  \u0412\u0441\u0435 \u044d\u0442\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0435\u0441\u0442\u044c \u043c\u043e\u0449\u043d\u0435\u0439\u0448\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441 \u0441\u0435\u0442\u044c\u044e \u0432 Java.<\/p>\n<p>  \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 <b>Retrofit 2<\/b> \u043d\u0435 \u0432\u0438\u0436\u0443 \u0441\u043c\u044b\u0441\u043b\u0430, \u0432\u043e\u0442 \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043c\u0430\u043d\u0443\u0430\u043b: <a href=\"https:\/\/habr.com\/ru\/post\/429058\/\/\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Retrofit 2 \u0432 Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 NetworkService:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class NetworkService {      private static final String TAG = &quot;NetworkService&quot;;      private static final NetworkService             mInstance = new NetworkService();      private String mToken;     private Retrofit mRetrofit;      public static NetworkService getInstance() {         return mInstance;     }      private NetworkService() {          RxJava2CallAdapterFactory rxAdapter =                 RxJava2CallAdapterFactory                         .createWithScheduler(Schedulers.io());          HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();         interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);           OkHttpClient.Builder okHttpClient =                 new OkHttpClient.Builder()                         .addInterceptor(interceptor)                         .addInterceptor(chain -&gt; {                             Request newRequest =                                     chain.request().newBuilder()                                            .addHeader(&quot;Accept&quot;,                                                      &quot;application\/json,text\/plain,*\/*&quot;)                                            .addHeader(&quot;Content-Type&quot;,                                                     &quot;application\/json;odata.metadata=minimal&quot;)                                            .addHeader(&quot;Authorization&quot;, mToken)                                     .build();                              return chain.proceed(newRequest);                         });          Gson gson = new GsonBuilder()                 .setDateFormat(&quot;yyyy-MM-dd'T'HH:mm:ssZ&quot;)                 .create();          mRetrofit = new Retrofit.Builder()                 .baseUrl(Const.BASE_URL)                 .addConverterFactory(GsonConverterFactory.create(gson))                 .addCallAdapterFactory(rxAdapter)                 .client(okHttpClient.build())                 .build();     }     public ApiService getNetworkClient(){         return mRetrofit.create(ApiService.class);     } } <\/code><\/pre>\n<p>  <b>listing 2<\/b><\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 API:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public interface ApiService { \/\/ \u0414\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 @GET(&quot;odata\/product&quot;) Observable&lt;List&lt;ProductsDto&gt;&gt; getProducts(); } <\/code><\/pre>\n<p><b>listing 3<\/b><\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u043a\u043e\u0439 \u043d\u0438\u0431\u0443\u0434\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0447\u0442\u043e \u0431\u044b \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class ProductsController {      private ApiService mApiService;      private List&lt;ProductsDto&gt; listProducts;     private Gson gson;      public ProductsController() {          mApiService = App.getNetworkService().getNetworkClient();          listProducts = new ArrayList&lt;&gt;();          gson = new Gson();     }      public void productsBtnClick() {          mApiService.getProducts()                 .subscribeOn(Schedulers.io())                 .observeOn(AndroidSchedulers.mainThread())                 .subscribe(new DisposableObserver&lt;List&lt;ProductsDto&gt;&gt;() {                     @Override                     public void onNext(List&lt;ProductsDto&gt; products) {                          listProducts.addAll(listProducts);                     }                      @Override                     public void onError(Throwable e) {                      }                      @Override                     public void onComplete() {                     }                 });     } <\/code><\/pre>\n<p><b>listing 4<\/b><\/div>\n<\/div>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445 Poduct, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u0435\u0435\u0442 \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b. \u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0434\u0443\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON \u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c POJO \u043a\u043b\u0430\u0441\u0441. <\/p>\n<p>  \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432 HttpLoggingInterceptor \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u2014 Level.BODY. <\/p>\n<p>  \u0414\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 <b>listing 4<\/b>, \u0447\u0442\u043e\u0431\u044b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0442\u044f\u043d\u0443\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0442\u0432\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<pre><code class=\"java\">\/\/ \u0415\u0441\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0441\u0448\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \/\/ \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON {   &quot;@odata.context&quot;:&quot;https:\/\/example.xxx\/api\/odata\/$metadata&quot;,&quot;value&quot;:[     {       &quot;name&quot;:&quot;product&quot;,&quot;kind&quot;:&quot;EntitySet&quot;,&quot;url&quot;:&quot;product&quot; \/\/ \u043f\u0440\u043e\u0434\u0443\u043a\u0442      },{       &quot;name&quot;:&quot;blogs&quot;,&quot;kind&quot;:&quot;EntitySet&quot;,&quot;url&quot;:&quot;blogs&quot;  \/\/ \u0431\u043b\u043e\u0433\u0438     },{       &quot;name&quot;:&quot;posts&quot;,&quot;kind&quot;:&quot;EntitySet&quot;,&quot;url&quot;:&quot;posts&quot;  \/\/ \u043f\u043e\u0441\u0442\u044b     },{       &quot;name&quot;:&quot;comments&quot;,&quot;kind&quot;:&quot;EntitySet&quot;,&quot;url&quot;:&quot;comments&quot; \/\/ \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438     },{       &quot;name&quot;:&quot;rates&quot;,&quot;kind&quot;:&quot;EntitySet&quot;,&quot;url&quot;:&quot;rates&quot; \/\/ \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0438     }   ] } <\/code><\/pre>\n<p>  <b>listing 5<\/b><\/p>\n<p>  \u0418 \u0443\u0436\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. <\/p>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043a\u0430\u043a\u0438\u043c \u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0430\u0448 DataSource \u043d\u0435 \u0432\u044b\u0434\u0443\u043c\u044b\u0432\u0430\u044f \u043d\u043e\u0432\u044b\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0438 \u043d\u0435 \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u044f \u043a \u043d\u0435\u043c\u0443 \u043a\u043e\u0441\u0442\u044b\u043b\u0438.<\/p>\n<h2>\u041a\u0443\u043b\u044c\u043c\u0438\u043d\u0430\u0446\u0438\u044f \u0438 \u0449\u0435\u043d\u044f\u0447\u0438\u0439 \u0432\u043e\u0441\u0442\u043e\u0440\u0433 \u043e\u0442 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430<\/h2>\n<p>  \u0418 \u0432\u043e\u0442 \u043e\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u044b, \u043c\u043e\u0449\u044c, \u0441\u0438\u043b\u0430 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <b>Retrofit 2<\/b>. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c properties \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 <b>Odata<\/b>:<\/p>\n<pre><code class=\"java\">\/\/ \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c properties \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 product @GET(&quot;odata\/product?$filter=Id eq 111&$expand=dateReading($orderby=Date desc&quot;) Observable&lt;List&lt;ProductsDto&gt;&gt; getProducts();  \/\/ \u0418\u043b\u0438 properties \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 blogs @GET(&quot;odata\/blogs?$orderby=Date desc&quot;) Observable&lt;List&lt;BlogsDto&gt;&gt; getBlogs();  \/\/ \u0418 \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439 @GET(&quot;odata\/product?$filter=((Id eq 19) and (Name eq 'Available')) and ((Status eq 'OPEN') or ((Status eq 'CLOSED') and (Date ge 2020-02-13T06:39:48Z)))&$orderby=Status asc,Date desc&$top=10&$expand=AuthorId,CategoryId($expand=weight)&$count=true&quot;) Observable&lt;List&lt;ProductsDto&gt;&gt; getProducts(); \/\/ \u042d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u0434\u0430\u0441\u0442 \u0442\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0442\u043e\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c, \/\/ \u043d\u043e \u043e\u043d \u044f\u0432\u043d\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0435 \u0440\u0430\u043c\u043a\u0438.   \/\/ \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c: @GET Observable&lt;List&lt;ProductsDto&gt;&gt; getProducts(@Url String url); <\/code><\/pre>\n<p>  <b>listing 6<\/b><\/p>\n<p>  \u0412\u043e\u0442 \u043e\u043d\u0430 \u0441\u0438\u043b\u0443\u0448\u043a\u0430 \u0431\u043e\u0433\u0430\u0442\u044b\u0440\u0441\u043a\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <b>Retrofit 2<\/b>. \u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 Url \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0432\u0441\u044e \u044d\u0442\u0443 \u043c\u0430\u0441\u0441\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435 \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u0432\u0430\u0442\u0438\u0442 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a \u0442\u043e \u0442\u0430\u043a:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">private void buttonGetProduct() { \/\/ \u0417\u0434\u0435\u0441\u044c \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0435         String one = &quot;odata\/product?$filter=Id eq &quot;;         String id = &quot;777&quot;;         String tree = &quot;&$expand=dateReading($orderby=Date desc)&quot;;         String url = one + id + tree;          mApiService.getProduct(url)                 .subscribeOn(Schedulers.io())                 .observeOn(AndroidSchedulers.mainThread())                 .subscribe(new DisposableObserver&lt;List&lt;ProductDto&gt;&gt;() {                     @Override                     public void onNext(List&lt;ProductDto&gt; products) {  \/\/ \u0410 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0441\u043a\u043e\u043c\u043e\u0435, \u043f\u0440\u0430\u0432\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON, \/\/ \u043d\u043e \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u043e\u0432 \u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430                          mProductsDto.addAll(countersDtos);                     }                      @Override                     public void onError(Throwable e) {                     }                      @Override                     public void onComplete() {                     }                 });     }<\/code><\/pre>\n<p><b>listing 7<\/b><\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u0418\u0442\u043e\u0433\u0438<\/h3>\n<p>  \u042d\u0442\u043e \u0431\u044b\u043b \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043e\u043f\u044b\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u0438 \u0441\u043f\u0435\u0448\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f, \u043c\u043d\u0435 \u0432 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0431\u044b \u0443\u0431\u0440\u0430\u043b\u0430 \u043a\u0443\u0447\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. <\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u043e <b>Retrofit 2<\/b> \u0438 <b>OData<\/b> \u0438 \u0443\u043a\u0430\u0437\u0430\u043b \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0435\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435.<\/p>\n<p>  \u041f\u043e\u043b\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043a\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443, \u0437\u0430 \u0447\u0442\u043e \u043f\u0440\u0438\u043d\u043e\u0448\u0443 \u0438\u0437\u0432\u0438\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439.<\/p>\n<p>  \u0418, \u043a\u0430\u043a \u043e\u0431\u0435\u0449\u0430\u043b, \u0441\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p>  <a href=\"https:\/\/docs.microsoft.com\/en-us\/odata\/\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Microsoft: Open Data Protocol<\/a> <br \/>  <a href=\"https:\/\/olingo.apache.org\/doc\/odata4\/index.html\">Documentation OData 4.0 Java Library<\/a><br \/>  <a href=\"https:\/\/docs.microsoft.com\/ru-ru\/archive\/msdn-magazine\/2010\/june\/practical-odata-building-rich-internet-apps-with-the-open-data-protocol\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c Open Data Protocol<\/a><\/div>\n<p> \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\/489688\/\"> https:\/\/habr.com\/ru\/post\/489688\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489688\/\">\u0421\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043e\u0441\u0435\u043b\u0435 \u043d\u0435 \u0432\u0438\u0434\u0430\u043d\u043d\u043e\u0439. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u043a\u0443\u0440\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>RxJava<\/b> \u0438 <b>Retrofit 2<\/b> \u2014 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 <b>Odata<\/b> \u0434\u043b\u044f android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 <b>Jake Wharton<\/b> \u0437\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h3>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 \u043c\u0438\u0440 \u043c\u0430\u0433\u0438\u0438<\/h3>\n<p>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 <b>Odata<\/b> \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u0440\u0435\u0431\u0430\u0442\u044c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u043f\u0438\u0441\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0422\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043d\u043e \u043d\u0435 \u0442\u0443\u0442 \u0442\u043e \u0431\u044b\u043b\u043e, \u0442\u043e \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e \u043d\u0430 Java \u2014 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442 \u0442\u0430\u043a \u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 android.<\/p>\n<p>  \u0410 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 <b>Odata<\/b> \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 Apache \u2014 Olingo \u0438 Microsoft \u043d\u0430 C#. <\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b <b>Odata<\/b> \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c \u0443 Microsoft \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.   <\/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-299172","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299172","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=299172"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299172\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}