Skip to content
Advertisement

How to hande error null body in retrofit?

Im trying to post data with retrofit with jwt bearer authentication, but when i debug response code, its error 400, and the message is body = null

This is my Intefrace class

JavaScript

This is my model class

JavaScript

And the main class is

JavaScript

And the error is

enter image description here

And

enter image description here

Advertisement

Answer

Might be an issue with how the JSON is formatted, compared to what you’re expecting. Are you able to use something like Postman and try this API call to see the format it comes back? Can’t tell that much but the error message shown is finding some array somewhere in the JSON

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement