title: How to handle No Content response using RxJava2 et Retrofit2
body: <p>I'm using <code>RxJava 2</code> &amp; <code>Retrofit 2</code> (<a href="https://github.com/JakeWharton/retrofit2-rxjava2-adapter" rel="nofollow noreferrer">https://github.com/JakeWharton/retrofit2-rxjava2-adapter</a>) and I was wondering how to handle no response (204) type. 
  In rxjava1 i was using <code>Observable&lt;Void&gt;</code> but it's not allowed by rxjava2 anymore (<a href="https://github.com/ReactiveX/RxJava/wiki/What&#39;s-different-in-2.0" rel="nofollow noreferrer">https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0</a> -> Nulls)</p>
  
  <p>Right now, i've hacked around to bypass Json parsing on a custom type (I called it NoContent) but I was wondering if there is a better way.</p>
  
  <p>EDIT:</p>
  
  <pre><code>public class NoContent {
      public static class GsonTypeAdapter extends TypeAdapter&lt;NoContent&gt; {
  
          @Override
          public void write(JsonWriter out, NoContent value) throws IOException {
             out.nullValue();
          }
  
          @Override
          public NoContent read(JsonReader in) throws IOException {
             return new NoContent();
          }
      }
  }
  </code></pre>