title: $_POST in php not populated using Volley library JsonObjectRequest (method POST)
body: <p>Let's start with the code I am using, I have tried every single possible different way to make "params". I have used it as a HashMap, in Json format and also as a string. I have also tried to @Override the getParams() method by creating a hashmap and returning it. Nothing as worked.</p>
  
  <p>Here is my function that calls the JsonObjectRequest.</p>
  
  <pre><code> private void sendJsonObjReq() {
  
      showProgressDialog();
      Map&lt;String, String&gt; para = new HashMap&lt;&gt;();
  
      para.put("Condicao", "dea");
      para.put("Field", "1550");
      JSONObject jason = new JSONObject(para);
  
      String params = jason.toString();
      textView.setText(params);
  
          JsonObjectRequest jsonReq = new JsonObjectRequest(JsonRequest.Method.POST,
                  url_cond1, params,
                  new Response.Listener&lt;JSONObject&gt;() {
  
                      @Override
                      public void onResponse(JSONObject response) {
                          Log.d(AppController.TAG, response.toString());
                          textView.setText(response.toString());
  
                      /*try {
                          int u = response.getInt("sucess");
                          if(u == 1){
  
                              JSONArray json = response.optJSONArray("Type");
                              if(json != null) {
                                  MakeListHashMap(json);
                              }else{
                                  textView.setText("Wrong Parameters");
                              }
                          }else{textView.setText("success is 0");}
                      }catch(JSONException e){
                          Log.e("Error:", e.getMessage());
                          textView.setText("nothing here");
                      }*/
                          hideProgressDialog();
                      }
                  }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  VolleyLog.d(AppController.TAG, "Error:" + error.getMessage());
                  showProgressDialog();
              }
          });
          //Add to request queue
      AppController.getInstance().addToRequestQueue(jsonReq, tag_json_obj);
  
  }
  </code></pre>
  
  <p>The url and everything else is fine, i have checked but i just cannot understand why neither the GET or POST method work, since i have tried both but I did not have any success with them. My php code consists of this: </p>
  
  <pre><code>&lt;?php
      $response = array();
  //$oi = json_decode($_POST);
  //$response["Condicao"] = $_GET["Condicao"];
  //$response["Field"] = $_GET["Field"];
      $response["Condicao"] = $_POST["Condicao"];
      $response["Field"] = $_POST["Field"];
  
      $response['sucess'] = 1;
      $response['other'] = "test";
  
      echo json_encode($response);
  ?&gt;
  </code></pre>
  
  <p>I have tried decoding it and not decoding it, I really am at a loss for what to do. I think it might be a problem with the server but using the App "Postman" I can send GET and POST and the response is a Json array like i want.</p>
  
  <p>If i send
  key1= Condicao => name=dea;
  key2= Field => name=1550;</p>
  
  <p>I get the result</p>
  
  <pre><code>{
       "Condicao": "dea",
       "Field": "1550",
       "sucess": 1,
       "other": "test"
  }
  </code></pre>
  
  <p>edit: The solution is:</p>
  
  <pre><code>&lt;?php
      $_POST = json_decode(file_get_contents('php://input'), true);
      $response = array();
  
      $response["Condicao"] = $_POST["Condicao"];
      $response["Field"] = $_POST["Field"];
  
      $response['sucess'] = 1;
      $response['other'] = "test";
  
      echo json_encode($response);
  ?&gt;
  </code></pre>