android - Send Request as JSON param inside JSON object -


i want send request parameters in json format. problem not able send request below format. can me resolve it?

{     "user": {         "email" : "",         "password": "",         "password_confirmation": ""     } } 

try this

      try {             jsonobject parent = new jsonobject();             jsonobject jsonobject = new jsonobject();              jsonobject.put("email", "email");             jsonobject.put("password", "password");             jsonobject.put("password_confirmation", "password_confirmation");             parent.put("user", jsonobject);             log.d("output", parent.tostring());         } catch (jsonexception e) {             e.printstacktrace();         } 

it return jsonobject output

{     "user": {         "email" : "email",         "password": "password",         "password_confirmation": "password_confirmation"     } } 

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

angular - Copying node modules to wwwroot AspNetCore -