title: Android how to handle retrofit response when Content-Type = application/octet-stream?
body: <h2>retrofit request interface:</h2>
  
  <pre><code>public interface IDataService {
        // Request URL:             https://demo.testdata.com/getData/order?timeStamp=1491986181670&amp;callerId=android_platform
        // Request Method:          GET
        // Response Content-Type:   application/octet-stream
        @GET("https://demo.testdata.com/getData/" + "{type}")
        Observable&lt;Response&gt; getTestData(@Path(value = "type", encode = false) String type
                , @Query("callerId") String callerId, @Query("timeStamp") long timeStamp);
    }
  </code></pre>
  
  <h2>Use the retrofit request interface:</h2>
  
  <p>In TestActivity.java</p>
  
  <pre><code>public Observable&lt;String&gt; getTestData(IDataService dataService) {
          final BehaviorSubject&lt;String&gt; subject = BehaviorSubject.create();
          if (null == dataService) {
              subject.onError(new NullPointerException());
              return subject;
          }
  
          bindObservable(dataService.getTestData("order", "android_platform", new Date().getTime())).subscribeOn(Schedulers.io())
                  .subscribe(new Subscriber&lt;Response&gt;() {
                      @Override
                      public void onCompleted() {
                      }
  
                      @Override
                      public void onError(Throwable e) {
                          subject.onError(e);
                      }
  
                      @Override
                      public void onNext(retrofit.client.Response response) {
                          // TODO: how to handle the response body content?
                          // In general, response is  json string. Then  parse and convert json string to Object.
                          // Now Response Content-Type = application/octet-stream, How to handle it?
  
                      }
                  });
          return subject.asObservable();
      }
  </code></pre>
  
  <h2>Question: In general, response Content-Type=application/json, parse JSON string to Object.  Now,Response Content-Type = application/octet-stream, How to handle it?</h2>
  
  <h2>Ref:</h2>
  
  <ul>
  <li>com.squareup.retrofit:retrofit:1.9.0</li>
  <li>io.reactivex:rxjava:1.1.0</li>
  <li>io.reactivex:rxandroid:1.1.0</li>
  </ul>