- Code: Select all
if request.post? and not params[:user].blank? and not params[:user][:email].blank? ...
(Client side)
Using java Syntax Highlighting
- List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
- nameValuePairs.add(new BasicNameValuePair("user", null));
- nameValuePairs.add(new BasicNameValuePair("email", "abc@gmail.com"));
- httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
but server is unable to parse my request and send me that "email is empty".
Basically what i need is to to product the Java equivalent of this PHP:
Using php Syntax Highlighting
- $params = array('user' => array(
- 'email' => 'abc@gmail.com',
- ));
Parsed in 0.055 seconds, using GeSHi 1.0.8.4
And this is the same request in JSON format:
- Code: Select all
{"user":{"firstname":"Bob Smith","lastname":"Johnson"}}

