title: Send post data to server using Volley android
body: <p>I am trying to send some data to the server using the Volley library.</p>
  
  <pre><code>   private void registerUser(final String email, final String username,
                            final String password) {
      // Tag used to cancel the request
      String tag_string_req = "req_register";
  
      pDialog.setMessage("Registering ...");
  
  
      StringRequest strReq = new StringRequest(Method.POST,
              AppConfig.URL_REGISTER, new Response.Listener&lt;String&gt;() {
  
          @Override
          public void onResponse(String response) {
              Log.d(TAG, "Register Response: " + response.toString());
  
  
              try {
                  JSONObject jObj = new JSONObject(response);
                //  String status = jObj.getString("status");
  
                      // User successfully stored in MySQL
                      // Now store the user in sqlite
  
                      String name = jObj.getString("username");
                      String email = jObj.getString("email");
                      String password = jObj.getString("password");
                     // String created_at = user
                              //.getString("created_at");
  
                      // Inserting row in users table
                     // db.addUser(name, email);
  
                      // Launch login activity
                      Intent intent = new Intent(
                              RegisterActivity.this,
                              LoginActivity.class);
                      startActivity(intent);
                      finish();
  
  
              } catch (JSONException e) {
                  e.printStackTrace();
              }
  
          }
      }, new Response.ErrorListener() {
  
          @Override
          public void onErrorResponse(VolleyError error) {
              Log.e(TAG, "Registration Error: " + error.getMessage());
              Toast.makeText(getApplicationContext(),
                      error.getMessage(), Toast.LENGTH_LONG).show();
  
          }
      }) {
  
          @Override
          protected Map&lt;String, String&gt; getParams() {
              // Posting params to register url
              Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
  
  
              params.put("email", email);
              params.put("username", username);
              params.put("password", password);
  
              return params;
          }
  </code></pre>
  
  <p>Unfortunately no json is sent and I get nothing back. Here is a sample of my logcat output. After sending a request successfully to the server, I want to get response with success/fail.</p>
  
  <pre><code>Register Response: ---- YOUR DATA ----
  username=xxx&amp;email=xxx%40gmail.com&amp;password=xxxx&amp;-------------------
  05-05 14:56:55.002    2558-2558/app.victory.walking.thewalkingviktory   
  W/System.err﹕ org.json.JSONException: Value ---- of type java.lang.String   
  cannot be converted to JSONObject
  05-05 14:56:55.002    2558-2558/app.victory.walking.thewalkingviktory   
  W/System.err﹕ at org.json.JSON.typeMismatch(JSON.java:111)
  05-05 14:56:55.002    2558-2558/app.victory.walking.thewalkingviktory   
  W/System.err﹕ at org.json.JSONObject.&lt;init&gt;(JSONObject.java:160)
  05-05 14:56:55.002    2558-2558/app.victory.walking.thewalkingviktory   
  W/System.err﹕ at org.json.JSONObject.&lt;init&gt;(JSONObject.java:173)
  </code></pre>
  
  <p>Any help please? Thanx.</p>