title: Android Retrofit JSON POST code=400, message=Bad Request
body: <p>I am new to Adroid developing. I have a login form which I have to post to server. I am using Retrofit 2 library. I get response  code=400, message=Bad Request. What am i doing wrong?
  Here is my interface:</p>
  
  <pre><code>public interface LoginService {
  @POST("login")
  Call&lt;Login&gt; createLogin(@Body Login login);
  </code></pre>
  
  <p>}</p>
  
  <p>My Activity:</p>
  
  <pre><code>Login login = new Login(email, password);
          Retrofit.Builder builder = new Retrofit.Builder()
                  .baseUrl("https://xxxxxx.herokuapp.com/")
                  .addConverterFactory(GsonConverterFactory.create());
          Retrofit retrofit = builder.build();
          LoginService loginClient = retrofit.create(LoginService.class);
  
          Call&lt;Login&gt; call = loginClient.createLogin(login);
          call.enqueue(new Callback&lt;Login&gt;() {
              @Override
              public void onResponse(Call&lt;Login&gt; call, Response&lt;Login&gt; response) {
                  Log.d("response",response.toString());
  
              }
  
              @Override
              public void onFailure(Call&lt;Login&gt; call, Throwable t) {
                  Toast.makeText(LoginActivity.this,":(",Toast.LENGTH_SHORT).show();
              }
          });
  </code></pre>
  
  <p>And my Login class:</p>
  
  <pre><code>public class Login {
  private String email;
  private String password;
  
  public Login(String email, String password){
      this.email = email;
      this.password = password;
  }
  </code></pre>
  
  <p>For login, app has to send json comprised like</p>
  
  <pre><code>{"email" : "x@y.z","password" : "abc",}
  </code></pre>
  
  <p>Thank you in advance!</p>