title: Retrofit 500 Internal Server Error, Postman working
body: <p>I know there must've been 1000 posts like this one, but I searched for the mistake everywhere and could not find it, so i hope you guys can take a look and tell me if you notice something i am missing.</p>
  
  <p><strong>Token class</strong></p>
  
  <pre><code>public class Token {
  
  public static final String POST = "tokens";
  
  @SerializedName("token")
  @Expose
  private String token;
  @SerializedName("role")
  @Expose
  private String role;
  
  public String getToken() {
      return token;
  }
  
  public void setToken(String token) {
      this.token = token;
  }
  
  public String getRole() {
      return role;
  }
  
  public void setRole(String role) {
      this.role = role;
      }
  }
  </code></pre>
  
  <p><strong>Entity class</strong></p>
  
  <pre><code>public class Entity {
  
  public Entity(){}
  
  private Token mToken;
  
  @SerializedName("email")
  @Expose
  private String mEmail;
  @SerializedName("password")
  @Expose
  private String mPassword;
  
  public Entity setFirstName(String firstName){return this;}
  public Entity setLastName(String lastName){return this;}
  public Entity setEmail(String email){
      mEmail = email;
      return this;
  }
  public Entity setPassword(String password){
      mPassword = password;
      return this;
  }
  public Entity setPasswordConfirmation(String passwordConfirmation){return this;}
  public Entity setAddress(String address){return this;}
  public Entity setCity(String city){return this;}
  public Entity setCountryId(Integer countryId){return this;}
  public Entity setToken(Token token){
      mToken = token;
      return this;
  }
  
  public String getEmail(){ return mEmail; }
  public String getPassword(){ return mPassword; }
  public Token getToken(Token token){ return mToken; }
  }
  </code></pre>
  
  <p><strong>APIService</strong></p>
  
  <pre><code> @POST(Token.POST)
  Observable&lt;Token&gt; loginEntity(@Body Entity entity);
  </code></pre>
  
  <p><strong>API call</strong></p>
  
  <pre><code>Observable&lt;Token&gt; loginEntityCall = RestClient.getInstance().service.loginEntity(loginEntity);
  </code></pre>
  
  <p><strong>What OkHttp outputs</strong></p>
  
  <blockquote>
    <p>--> POST <a href="http://randomapi/api/v1/tokens" rel="nofollow noreferrer">http://randomapi/api/v1/tokens</a> http/1.1<br>
    Content-Type: application/json; charset=UTF-8<br>
    Content-Length: 55<br>
    {"email":"sample.user@example.com","password":"123456"}<br>
    --> END POST (55-byte body)    </p>
  </blockquote>
  
  <p>It returns </p>
  
  <blockquote>
    <p>&lt;-- 500 Internal Server Error</p>
  </blockquote>
  
  <p><strong>Here is the copied value into postman</strong></p>
  
  <p><a href="https://i.stack.imgur.com/SutlW.png" rel="nofollow noreferrer">postman</a></p>
  
  <p>So postman gives OK, and my app gives me 500. I checked all values and i cannot find the mistake. :p</p>