title: Unexpected response code 500 for POST method
body: <p>I am doing an update on the old project &amp; I don't have much knowledge of Android as of now. In project we have Comments section on product.</p>
  
  <p>For comment after sending earlier we had return as 0 (some error) &amp; 1 (success).</p>
  
  <p>Below is the code we were using.</p>
  
  <pre><code>final JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(
      Method.POST,
      act.getString(R.string.CommentForUserURL),
      null, new Response.Listener&lt;JSONObject&gt;() {
  
      @Override
      public void onResponse(
              JSONObject response) {
  
          Log.d("response done", "done===" + response);
  
          mloading.setVisibility(View.GONE);
          if (response != null) {
              Comment obj = new Comment();
              JSONObject jsonObject = response;
              try {
                  obj.setComment(jsonObject
                          .getString("Comment"));
  </code></pre>
  
  <p>Now we have changed the return object from 0/1 to user object.</p>
  
  <p>Does this need need to update JsonObjectRequest to GJSON request? Or object will also get parsed with JsonObjectRequest?</p>
  
  <p>I am asking because when I execute above, I get error as below.</p>
  
  <pre><code>01-25 12:30:21.754: E/Volley(16487): [10114] BasicNetwork.performRequest: 
  Unexpected response code 500 for 
  http://new.souqalharim.com/add/CommentForMerchant
  </code></pre>
  
  <p>Any idea why I am getting this error?</p>
  
  <p><em>Note: This URL is working fine for iPhone application.</em></p>
  
  <hr>
  
  <h2>Edit 1</h2>
  
  <p>This is post method, so full url is not there. There are few more parameters to add like ?comment=MyComment&amp;userId=123&amp;productId=234. As it is post I am not adding parameters in actual url.</p>
  
  <p>I have those in another methods</p>
  
  <pre><code>@Override
  protected Map&lt;String, String&gt; getParams()
          throws AuthFailureError {
      Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
      params.put("productId", productId.toString());
      params.put("userId",
              mSessionManager.getUserCode().toString());
      params.put("comment", GlobalFunctions
              .EncodeParameter(med_comments
                      .getText().toString()));
  
  
  
      return params;
  }
  </code></pre>
  
  <p>Full url is as below.</p>
  
  <p><a href="http://new.souqalharim.com/add/CommentForUser?productId=325&amp;userId=5&amp;comment=abcd" rel="noreferrer">http://new.souqalharim.com/add/CommentForUser?productId=325&amp;userId=5&amp;comment=abcd</a></p>
  
  <p>I tested this in Mozilla RESTClient and it works fine.</p>
  
  <hr>
  
  <h2>Edit 2</h2>
  
  <p>After checking further I found <code>protected Map&lt;String, String&gt; getParams() throws AuthFailureError {</code> is not getting called. Any idea why this is happening?</p>