'How to parse raw data in android kotlin using retrofit?
Solution 1:[1]
So after looking around and from the last comment above, i have resolved the issue. Here is the result.
If you have non json structure in api response, you just need to replace the GsonConverterFacroty line from the retrofit client i.e
.addConverterFactory(GsonConverterFactory.create())
with
.addConverterFactory(ScalarsConverterFactory.create())
and that's all. You can add both if you have mix responses i.e json and non-json.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kashif Ahmad |