title: Retrofit getting empty parameters from POST call
body: <p>I'm using retrofit for making API calls in my android app.Everything works fine with the GET requests ,but when I call the API with POST method and pass my custom object to it with @Body annotation ,the API doesn't receives the parameters passed.I tested the same API with same values in POSTMAN and I got the response.I've been using Retrofit for a while but not getting what exactly is happening in this case.Any help would be appreciated.</p>
  
  <p>ApiInterface.java</p>
  
  <pre><code>@POST("User/login")
  @Headers("x-api-key: 123456")
  Call&lt;LoginResponse&gt; login(@Body LoginRequest loginRequest);
  </code></pre>
  
  <p>LoginRequest.java</p>
  
  <pre><code>public class LoginRequest {
  
  @SerializedName("email")
  @Expose
  public String email;
  @SerializedName("password")
  @Expose
  public String password;
  @SerializedName("deviceType")
  @Expose
  public Integer deviceType;
  @SerializedName("deviceId")
  @Expose
  public String deviceId;
  @SerializedName("versionName")
  @Expose
  public String versionName;
  
  public LoginRequest() {
  }
  
  public LoginRequest(String email, String password, Integer deviceType, String deviceId, String versionName) {
      super();
      this.email = email;
      this.password = password;
      this.deviceType = deviceType;
      this.deviceId = deviceId;
      this.versionName = versionName;
  }
      //getters and setters
  
  }
  </code></pre>
  
  <p>LoginResponse.java</p>
  
  <pre><code>public class LoginResponse {
  
  @SerializedName("userId")
  @Expose
  private String userId;
  @SerializedName("firstName")
  @Expose
  private String firstName;
  @SerializedName("middleName")
  @Expose
  private Object middleName;
  @SerializedName("lastName")
  @Expose
  private String lastName;
  @SerializedName("email")
  @Expose
  private String email;
  @SerializedName("phone")
  @Expose
  private String phone;
  @SerializedName("userCompany")
  @Expose
  private String userCompany;
  @SerializedName("userName")
  @Expose
  private String userName;
  @SerializedName("userDesignation")
  @Expose
  private String userDesignation;
  @SerializedName("companyName")
  @Expose
  private String companyName;
  @SerializedName("photo")
  @Expose
  private Object photo;
  @SerializedName("userType")
  @Expose
  private String userType;
  @SerializedName("code")
  @Expose
  private String code;
  @SerializedName("countryCode")
  @Expose
  private String countryCode;
  @SerializedName("countryName")
  @Expose
  private String countryName;
  @SerializedName("supervisor")
  @Expose
  private String supervisor;
  @SerializedName("taskStatus")
  @Expose
  private Integer taskStatus;
  @SerializedName("checkInStatus")
  @Expose
  private Integer checkInStatus;
  @SerializedName("time")
  @Expose
  private String time;
  @SerializedName("checkInPlace")
  @Expose
  private String checkInPlace;
  @SerializedName("checkInId")
  @Expose
  private String checkInId;
  @SerializedName("checkinDate")
  @Expose
  private String checkinDate;
  @SerializedName("permission")
  @Expose
  private List&lt;Permission&gt; permission = null;
  
  public LoginResponse() {
  }
  
  public LoginResponse(String userId, String firstName, Object middleName, String lastName, String email, String phone, String userCompany, String userName, String userDesignation, String companyName, Object photo, String userType, String code, String countryCode, String countryName, String supervisor, Integer taskStatus, Integer checkInStatus, String time, String checkInPlace, String checkInId, String checkinDate, List&lt;Permission&gt; permission) {
      super();
      this.userId = userId;
      this.firstName = firstName;
      this.middleName = middleName;
      this.lastName = lastName;
      this.email = email;
      this.phone = phone;
      this.userCompany = userCompany;
      this.userName = userName;
      this.userDesignation = userDesignation;
      this.companyName = companyName;
      this.photo = photo;
      this.userType = userType;
      this.code = code;
      this.countryCode = countryCode;
      this.countryName = countryName;
      this.supervisor = supervisor;
      this.taskStatus = taskStatus;
      this.checkInStatus = checkInStatus;
      this.time = time;
      this.checkInPlace = checkInPlace;
      this.checkInId = checkInId;
      this.checkinDate = checkinDate;
      this.permission = permission;
  }
  
  //getters and setters
  }
  </code></pre>
  
  <p>ApiClient.java</p>
  
  <pre><code>public static Retrofit getClient() {
      if (retrofit == null) {
          retrofit = new Retrofit.Builder()
                  .baseUrl(BASE_URL)
                  .addConverterFactory(GsonConverterFactory.create())
                  .build();
      }
      return retrofit;
  }
  </code></pre>
  
  <p>POSTMAN screenshot</p>
  
  <p><a href="https://i.stack.imgur.com/zTBjE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zTBjE.png" alt="enter image description here"></a></p>