[英]How can i set different model for call and response using retrofit
is it possible to set two models for retrofit POST? 是否可以设置两个用于POST改造的模型? i want to set the first model that use Call POST to send json data and another model that handle the response from the server 我想设置使用Call POST发送json数据的第一个模型和处理服务器响应的另一个模型
To get to differents objects is pretty much straight foward: 寻求不同的对象是非常直接的:
@POST("yourMagicURL")
fun login(@Body loginRequest: User): Call<UserStatusResponse>
Where User is the object that contains: fname, lname, email and UserStatusResponse is the object that contains status, message 其中User是包含以下内容的对象:fname,lname,email和UserStatusResponse是包含状态,消息的对象
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.