Retrofit 2 login post request returns 500 but works well on postman

Hello, everyone, I’m implementing a login post method using retrofit 2. It works well in Postman but returns 500 error. I’ve tried different solutions , so here is my implementation:

INetworkAPI interface:

@FormUrlEncoded@POST("mobile/login")Call\<JsonObject\> login(@Field(value ="\_username")String username,@Field(value ="\_password")String password);

INetworkAPI interface:

login

publicvoid login(String \_username,String \_password,finalNetworkRequestObjectResult callBackResult){ mRoomPresenceAPI = provideApiService();Call\<JsonObject\> callObject = mRoomPresenceAPI.login(\_username, \_password); callObject.enqueue(newCallback\<JsonObject\>(){@Overridepublicvoid onResponse(Call\<JsonObject\> call,Response\<JsonObject\> response){if(response.body()!=null&& response.code()==200){Log.i(TAG,"mobile/login Success code: "+response.code()+" content: "+response.body().toString()); callBackResult.onSuccess(null);}else{if(response.errorBody()!=null){Log.e(TAG,"mobile/login error code: "+response.code()+" error content: "+response.errorBody().toString());//general error callBackResult.onError(mContext.getResources().getString(R.string.error\_login));}}}@Overridepublicvoid onFailure(Call\<JsonObject\> call,Throwable t){Log.e(TAG,"mobile/login error : "+t.getMessage()); callBackResult.onError(mContext.getResources().getString(R.string.error\_login));}});}

provide service

publicINetworkAPI provideApiService(){return provideRetrofit(BASE\_URL, provideClient()).create(INetworkAPI.class);}//provide clientpublicOkHttpClient provideClient(){ loadSSLConfig();OkHttpClient.Builder clientBuilder = getUnsafeOkHttpClient(); clientBuilder.addInterceptor(newResponseInterceptor());HttpLoggingInterceptor loggingInterceptor =newHttpLoggingInterceptor(); loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY); clientBuilder.addInterceptor(loggingInterceptor);return clientBuilder.build();}classResponseInterceptorimplementsInterceptor{@Overridepublic okhttp3.Response intercept(Interceptor.Chain chain)throwsIOException{ okhttp3.Response response = chain.proceed(chain.request());return response.newBuilder()}}  

provide retrofit

public Retrofit provideRetrofit(String baseURL, OkHttpClient client) {
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.setLenient();
gson = gsonBuilder.create();

return new Retrofit.Builder()
.baseUrl(baseURL)
.client(client)
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create(gson))
.build();
}

Base URL

public final String BASE_URL = “https://example.com/”;