title: I can't send POST request from android volley to php
body: <p>I'm using android volley StringRequest to send a post request to a PHP file which is already hosted online. This was working before but after the domain name was changed, this PHP file no longer receives the volley request as a post request. In the PHP file <code>$_SERVER['REQUEST_METHOD']</code> returns GET instead of POST. </p>
  
  <p>Here is the android volley request code snippet</p>
  
  <pre><code>StringRequest request = new StringRequest(Request.Method.POST, postURL, new Response.Listener&lt;String&gt;(){
          @Override
          public void onResponse(String s) {
              Log.d("MY_DEBUG",s);
  
          }
      },new Response.ErrorListener(){
          @Override
          public void onErrorResponse(VolleyError volleyError) {
  
          }
      }) {
          @Override
          public Map&lt;String, String&gt; getHeaders()
          {
              Map&lt;String, String&gt; parameters = new HashMap&lt;&gt;();
              parameters.put("Connection", "Keep-Alive");
              return parameters;
          }
  
          @Override
          public String getBodyContentType() {
              //return "application/x-www-form-urlencoded; charset=UTF-8";
              return "application/x-www-form-urlencoded";
          }
  
          //adding parameters to send
          @Override
          protected Map&lt;String, String&gt; getParams()  {
              Map&lt;String, String&gt; parameters = new HashMap&lt;&gt;();
              parameters.put("request", "edit_product");
              parameters.put("id", id);
  
              return parameters;
          }
      };
  
      request.setShouldCache(false);
      InitiateVolley.getInstance().addToRequestQueue(request);
  </code></pre>
  
  <p>And here are the few first lines of code in the PHP file that handles the post request from an android volley</p>
  
  <pre><code>if($_SERVER['REQUEST_METHOD']=='POST'){
  //it's a POST request, We are good to go...handle the post request.
  }else{
    //not a POST request, kill it here
    echo "error";
    die();
  }
  </code></pre>
  
  <p>What could be causing this issue? Is there a setting I have to do on the PHP side? Or maybe the PHP version of the new domain? Please help out</p>