How can I return String or JSONObject from asynchronous callback using Retrofit?

后端 未结 7 1786
无人及你
无人及你 2020-11-30 00:34

For example, calling

api.getUserName(userId, new Callback() {...});

cause:

retrofit.RetrofitError: retrofit.         


        
相关标签:
7条回答
  • 2020-11-30 01:17

    To get Call JSONObject or JSONArray

    you can create custom factory or copy it from here : https://github.com/marcinOz/Retrofit2JSONConverterFactory

    0 讨论(0)
提交回复
热议问题