Get custom Response using retrofit

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
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.
I don't understand what your question is. What is it you need help with?
– nasch
Jul 4 at 18:41