2

I need to make a sign-up route and decided to take a stab at using retrofit since everyone seems to like it.

However, I've come to a halt when building the sign-up route due to the info I need to send:

{"name":{
    "first_name":"Bob",
    "last_name":"Bobinski"},
"email":"bob@bob.com",
"birth_date":"12-31-1981",
"sex":"male",
"password":"123456"}

I do know about @FieldMap, and tried to do it with the following to no avail:

@FormUrlEncoded
@POST("/new_user")
void createNewUser(@FieldMap Map<String, Object> newUser, Callback<User> cb);

Other things I tried was to pass the whole JsonObject as a @Field and to convert it to a String before passing as well, neither worked.

Is there any way to get this done with retrofit or am I out of luck?

Larpus
  • 301
  • 1
  • 3
  • 17

0 Answers0