Retrofit and TypedInput

自闭症网瘾萝莉.ら 提交于 2019-12-14 04:09:57

问题


From the documentation, The TypedInput and TypedOutput classes exist only to bind a mime type to data. When we have to use the TypedInput in the Request. ?? Why we need this mapping while making the Request


回答1:


If you have consistent MIME type for all requests then you shouldn't bother about the TypedInput or TypedOutput. Let's say if you have JSON in and out for your request you should not consider using these. But if you have mixed requests, let's say byte stream, JSON and XML you should provide your own Converter and mapping for different requests.



来源:https://stackoverflow.com/questions/31377633/retrofit-and-typedinput

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!