I want to to make a POST request using Retrofit. My POST request has a body which is complex data like this
{
"user": {
"personal_info": {
"first_name": "Walter",
"last_name": "White",
"date_of_birth": "1972-01-03 00:00:00 PST"
},
"address_info": {
"address_1": "308 NEGRA ARROYO LANE",
"address_2": "#",
"city": "ALBUQUERQUE",
"state": "NM",
"zip_code": "87104"
},
"contact_info": {
"email": "wwhite@test.com",
"telephone": "88888888888",
"telephone_type_id": 1
},
"employment_info": {
"employer_name": "SELF",
"employment_status_id": 7,
"annual_income": 9000000000000000,
"monthly_income": 750000000000,
"employment_start_year": 0,
"employment_start_month": 0
}
}
}
I have the interface defined as
@POST("/users")
void user(@Body User User, Callback<User> cb);
I am not sure how my User class should look like, I want the payload to be same as mentioned above, I Am confused how to send this type of data server and how to store data in user class