简体   繁体   中英

internal server error 500 retrofit in android?

I am implementation for Retrofit on api call using images-upload base64Encode string. it is sending data perfect but Retrofit return response Internal Server Error 500 and i am sending request type is Body custom class. Plz help me what i do.

@Headers("Accept:application/json")
@POST(RestClient.postRegister)
Call<RegisterResp> getRegisterResponse(@Body RequestRegisterVo requestRegisterVo);

  Call<RegisterResp> call = MyApplication.getRestClient().getApplicationServices().getRegisterResponse(requestRegisterVo);

            call.enqueue(new Callback<RegisterResp>() {

                @Override
                public void onResponse(Call<RegisterResp> call, Response<RegisterResp> response) {
                    if (Other.isValidResp(response)) {
                    // success Log.i(TAG,"Register successfully");
                    } else {
                        hideDialog();
                    }
                }

                @Override
                public void onFailure(Call<RegisterResp> call, Throwable t) {
                    hideDialog();
                    showToast(t.getMessage());
                }
            });

The same issue I had to face it, I got a solution in my case-

there is parameter issue, I was sending parameters in String and at the backend, they required Integer parameters.

You also checkout may be there is the issue with parameters or second reason is the URL issue so check it URL also.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM