title: Retrofit returning internal server error status 500
body: <p>I am implementing retrofit in my android application for user login. The input type is Json. I have 500 internal server error, every time when i try to send POST request via Retrofit.</p>
  
  <pre><code>   ApiInterface apiInterface=AppController.GetRetrofitObject().create(ApiInterface.class);
          // prepare call in Retrofit 2.0
          try {
              JSONObject paramObject = new JSONObject();
              try {
                  paramObject.put(ApiName.USERNAME, username);
                  paramObject.put(ApiName.PASSWORD, password);
              } catch (JSONException e) {
                  e.printStackTrace();
              }
  
              Log.d(TAG,paramObject.toString());
              Call&lt;Login&gt; call = apiInterface.getLoginDetails(paramObject.toString());
              call.enqueue(new Callback&lt;Login&gt;() {
                  @Override
                  public void onResponse(@NonNull Call&lt;Login&gt; call, @NonNull Response&lt;Login&gt; response) {
                      String message = response.message();
                      int status = response.code();
  
                      Log.d(TAG, String.valueOf(status));
                      Intent homeIntent = new Intent(getApplicationContext(), MainActivity.class);
                      startActivity(homeIntent);
                  }
  
                  @Override
                  public void onFailure(Call&lt;Login&gt; call, Throwable t) {
  
                  }
              });
          }catch (Exception e){
              e.printStackTrace();
          }
  </code></pre>
  
  <p>Every time i am getting status as 500. But i am getting the response in POSTMAN.My Interface class is</p>
  
  <pre><code>  public interface ApiInterface {
  
  @POST(ApiName.LOGIN)
  Call&lt;Login&gt; getLoginDetails(@Body String body);
  } 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YAYAz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YAYAz.png" alt="Postman screen shot"></a></p>