any idea?
2013/7/25 Ricardo Cardoso <[email protected]> > Testing the console using CURL typing > curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' > -X POSThttp://localhost:3000/api/v1/registrations -d > "{\"user\":{\"email\":\"[email protected] > \",\"firstname\":\"anotheruser\",\"password\":\"secret1234\",\"password_confirmation\":\"secret1234\"}}" > > In console: > 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 in the app: > Parameters: {"email"=>"[email protected] <[email protected]>", > "firstname"=>"Ricardo", "password"=>"[FILTERED]", > "password_confirmation"=>"[FILTERED]", "registration"=>{"email"=>" > [email protected]", "firstname"=>"Ricardo", "password"=>"[FILTERED]", > "password_confirmation"=>"[FILTERED]"}} > > See missing object "("registration"=>{"email")"... > > How can I create a json well with AndroidAnnotations? > Help-me > > Como gerar um JSON daquele jeito pelo androidannotations... alguém sabe? > > 2013/7/25 Ricardo Cardoso <[email protected]> > >> Please, help me in AndroidAnnotations. I have a problem in send my JSON >> to for the WebService. >> >> >> I created my interface Rest >> >> @Rest(rootUrl="http://192.168.0.142:3000", >> converters={GsonHttpMessageConverter.class}) >> >> public interface UserRestClient { >> >> @Post("/api/v1/registrations/") >> >> User addUser(User user); >> >> >> And my activity is as follows: >> >> @RestService >> >> UserRestClient userRestClient; >> >> User user = new User(); >> >> user.setFirstname(mName); >> >> user.setEmail(mEmail); >> >> user.setPassword(mPassword); >> >> user.setPassword_confirmation(mPassword); >> >> userRestClient.addUser(user); >> >> >> In my console rails i have a error >> Started POST "/api/v1/registrations" for 192.168.0.138 at 2013-07-24 >> 11:23:21 -0300 >> Processing by Api::V1::RegistrationsController#create as JSON >> Parameters: {"email"=>"[email protected]", "firstname"=>"Ricardo", >> "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", >> "registration"=>{"email"=>"[email protected]", "firstname"=>"Ricardo", >> "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}} >> (0.2ms) BEGIN >> (0.2ms) ROLLBACK >> Completed 422 Unprocessable Entity in 3ms (Views: 0.3ms | ActiveRecord: >> 0.4ms) >> #<ActiveModel::Errors:0x007f842510eb80 @base=#<User id: nil, firstname: >> nil, lastname: nil, email: nil, password: nil, password_confirmation: nil, >> remember_me: nil, gender: nil, dateBirth: nil, modelPhone: nil, created_at: >> nil, updated_at: nil, encrypted_password: "", reset_password_token: nil, >> reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, >> current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, >> last_sign_in_ip: nil, confirmation_token: nil, confirmed_at: "2013-07-24 >> 14:25:24", confirmation_sent_at: nil, authentication_token: nil>, >> @messages={:email=>["can't be blank"], :password=>["can't be blank"]}> >> >> >> Do not know why JSON is going on without their user object, or because it >> duplicates the parameters, can someone help me? >> > > -- -- 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.

