Hello, all right?
I am using "AndroidAnnotations" in my project and I am having trouble to
understand this RestTemplate, how do ...
is this need my Json stay that way:
Parameters: {"user"=>{"email"=>"[email protected]",
"firstname"=>"anotheruser", "password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]"}, "registration"=>{"user"=>{"email"=>"
[email protected]", "firstname"=>"anotheruser",
"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}}}
But my Json being passed as follows
Parameters: {"dateOfBirth"=>nil, "email"=>"[email protected]",
"firstname"=>"Ricardo", "gender"=>nil, "lastname"=>nil,
"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]",
"picture"=>nil, "typeOS"=>nil, "modelPhone"=>nil,
"registration"=>{"dateOfBirth"=>nil, "email"=>"[email protected]",
"firstname"=>"Ricardo", "gender"=>nil, "lastname"=>nil,
"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]",
"picture"=>nil, "typeOS"=>nil, "modelPhone"=>nil}}
Is missing the "user" in json ... my code looks like:
My UserRestClient:
@Rest(rootUrl="http://192.168.1.101:3000",
converters={MappingJacksonHttpMessageConverter.class})
@Accept(MediaType.APPLICATION_JSON)
public interface UserRestClient {
RestTemplate getRestTemplate();
void setRestTemplate(RestTemplate restTemplate);
@Post("/api/v1/registrations")
void addUser(User user);
}
My method that call's my RestClient
@Background
void createAccount(User user) {
try {
userRestClient.addUser(user);
pd.dismiss();
sucessRegister();
} catch (Exception e) {
pd.dismiss();
errorRegister();
}
}
How do I pass this JSON correct?
Hugs
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.