title: Response 301 Moved Permanently
body: <p>I used to get the following response to php request </p>
  
  <p>Response:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;301 Moved Permanently&lt;/title&gt;&lt;/head&gt;
  &lt;body bgcolor="white"&gt;
  &lt;center&gt;&lt;h1&gt;301 Moved Permanently&lt;/h1&gt;&lt;/center&gt;
  &lt;hr&gt;&lt;center&gt;nginx&lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my code:</p>
  
  <pre><code> URL url = new URL("http://myappdemo.com/payumoney/payUmoneyHashGenerator.php");
  
       // get the payuConfig first
       String postParam = postParams[0];
  
       byte[] postParamsByte = postParam.getBytes("UTF-8");
  
       HttpURLConnection conn = (HttpURLConnection) url.openConnection();
       conn.setRequestMethod("POST");
       conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
       conn.setInstanceFollowRedirects(false);
       conn.setRequestProperty("Content-Length", 
       String.valueOf(postParamsByte.length));
       conn.setDoOutput(true);
       conn.getOutputStream().write(postParamsByte);
  
       InputStream responseInputStream = conn.getInputStream();
       StringBuffer responseStringBuffer = new StringBuffer();
       byte[] byteContainer = new byte[1024];
       for (int i; (i = responseInputStream.read(byteContainer)) != -1; ) {
       responseStringBuffer.append(new String(byteContainer, 0, i));
          }
  
       Log.e("tag", "doInBackground: "+ responseStringBuffer.toString());
  </code></pre>
  
  <p>also tried with volley reponse was </p>
  
  <blockquote>
    <p>BasicNetwork.performRequest: Unexpected response code 301 for
    <a href="http://myappdemo.com/payumoney/payUmoneyHashGenerator.php" rel="noreferrer">http://myappdemo.com/payumoney/payUmoneyHashGenerator.php</a></p>
  </blockquote>
  
  <p>.</p>
  
  <p>Please help me.
  Thanks in Advance.</p>