-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResponseHandler should allow to pass our own converter #39
Comments
If your response has an empty body, use the |
That is true but what happens when api returns sometimes 204 and other times an json object. We get an error... |
It would be better if you add another response such us Success (header..) without body and other with body, so developer have control about this kind of situations. |
I'm not sure what's the best way to handle your usecase. If your API response is unpredictable, it might be best to not use the Response converter factories usually don't accept other response converters as input parameters. If you have multiple types of response converters, you should add them to Retrofit directly. Retrofit.Builder()
.addCallAdapterFactory(...)
.addCallAdapterFactory(...)
.addCallAdapterFactory(...)
.addCallAdapterFactory(NetworkResponseAdapterFactory())
.build() |
umm I see yeah is another way to solve this issue but what I have done in this case is add a new type of success response called: SuccessWithEmptyBody so I just have modified library to support this kind of situation. |
ResponseHandler should allow to pass our own converter NullOnEmptyConverterFactory extends Converter.Factory.
I am not able to deal with reponses 204 using GET method and empty body because of this.
The text was updated successfully, but these errors were encountered: