When you communicate Retrofit2, the message End of input at line 1 column 1 appears and falls to onFailure.

Asked 2 years ago, Updated 2 years ago, 143 views

Retrofit2 is in use. If you communicate with the API that registers the user, it is processed well, so you can check that it has entered the DB, but in retrofit, it cannot go to onResponse and falls to onFailure. The error message is End of input at line 1 column 1.

The peculiarity is that even if communication is successful in API, the response value is not thrown separately. Yes) { "result": "success" }

I think it's a problem when the API doesn't throw it separately like above. I don't know even if I search it. I'll be waiting for your reply.

Thank you.

android retrofit2 response

2022-09-21 19:06

1 Answers

I think you're right.

https://github.com/square/retrofit/issues/1968

According to Jake Wharton, it happens when the response value is empty.

Call<Void>  

Try it with a.

Alternatively, you can add a converter that converts to null when the response is empty.

https://github.com/square/retrofit/issues/1554#issuecomment-178633697


2022-09-21 19:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.