title: Volley JsonObjectRequest error response code 500
body: <p>when i try to post json and take result as a json i get response code 500 error. But if i try this with string request there is no problem. I searched a lot on stackoverflow, there are other people like me having this problem but there is no up-to-date solution for this. So may anyone show me how i can do json object post request by up-to-date method(with also php side) please?</p>
  
  <p>Android side:</p>
  
  <pre><code>    Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); 
      map.put("user", username);
      map.put("pass", password);
  
      JsonObjectRequest sr = new JsonObjectRequest(Request.Method.POST, "http://www.example.com/example/.php?action=signin", new JSONObject(map), new Response.Listener&lt;JSONObject&gt;() {
          @Override
          public void onResponse(JSONObject result) {
  
          }
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
  
      }) {
          @Override
          public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
              Map&lt;String,String&gt; params = new HashMap&lt;String, String&gt;();
  
              return params;
          }
      };
  </code></pre>
  
  <p>PHP side:</p>
  
  <pre><code>$post = json_decode(file_get_contents("php://input"), true);
          $user = $post['user'];
          $pass = $post['pass'];
  
  $array = array("entrance" =&gt;  $example);
  
  echo json_encode($array,true);
  </code></pre>