Get custom Response using retrofit

Multi tool use
Multi tool use


Get custom Response using retrofit



I have custom response


{ "Status": 1, "Error": null,
"ResponseList": [{ "ErrorCode": 0, "Message": null,
"Content":{ "UserID": 107, "UserName": "alnounom", } } ] }



This JSON can be represented simply as a Java type.


public class GeneralResponse<T>
@SerializedName("Status") private int status;
@SerializedName("Error") private String error;
@SerializedName("ResponseList")
private ArrayList<ResponseObject<T>> response;



and


public class ResponseObject<T> { ..... @SerializedName("Content") private T content; }



And naively, our API declaration could use this .


ErrorHandlingCallAdapter .MyCall<GeneralResponse<User>> login(@Body RequestBody params);



I want to work with my desired types directly,


ErrorHandlingCallAdapter.MyCall<User>...



so i use this class ErrorHandlingCallAdapter



any help please





I don't understand what your question is. What is it you need help with?
– nasch
Jul 4 at 18:41









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

7,vxEalk8dU7aGcHU RalaOxoQsxMIak6ug
VXYgxxnlesm,pOj,4ZocVbzniTfIX7N31BAdyCb6Fv

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications