title: how to Passing headers and body at a time in retrofit
body: <p><strong>Im sending 2 headers and a body of class type here</strong></p>
  
  <pre><code> @POST("/api/access/change-password")
      Call&lt;JsonElement&gt; changePassword(@Header("Content-Type") String content_type,
      @Header("Authorization") String AuthToken,
      @Body PostChangePassword postChangePassword);
  </code></pre>
  
  <p>here i am posting the data to server. but it returns some error. It is working fine in postman. but not in here.</p>
  
  <pre><code>public void postData(String old_password, String new_password) {
      Log.v("im here in retro0", "");
      PostChangePassword postChangePassword = new PostChangePassword(sharedPrefUserData.getUserData().getUserId(), sharedPrefUserData.getUserData().getAuthToken(), old_password, new_password);
      mAPIService.changePassword("application/json", "Bearer " + sharedPrefUserData.getUserData().getAuthToken(), postChangePassword).enqueue(new Callback&lt;JsonElement&gt;() {
  
          @Override
          public void onResponse(Call&lt;JsonElement&gt; call, Response&lt;JsonElement&gt; response) {
              Log.v("im here in retro1", response + "");
              Gson gson = new Gson();
              if (response.code() == 200) {
                  JsonElement jsonElement = response.body();
                  if (jsonElement.isJsonObject()) {
                      JsonObject objectWhichYouNeed = jsonElement.getAsJsonObject();
                      ResponseChangePassword object = gson.fromJson(objectWhichYouNeed, ResponseChangePassword.class);
  
                  }
              } else {
                  Log.v("im here in retro2", response + "");
                  ResponseChangePassword responseChangePassword = null;
                  try {
                      responseChangePassword = gson.fromJson(response.errorBody().string(), ResponseChangePassword.class);
                      Toast.makeText(ProfileActivity.this, responseChangePassword.getMessage(), Toast.LENGTH_LONG).show();
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
              // progressBar.setVisibility(View.GONE);
          }
  
          @Override
          public void onFailure(Call&lt;JsonElement&gt; call, Throwable t) {
              //  progressBar.setVisibility(View.GONE);
              internetConnectionChecker.serverErrorAlert();
              Log.v("im here in retro3", "");
          }
      });
  }
  </code></pre>