title: POST between Python and PHP not working?
body: <p>I`m trying to communicate between my website and a client side script. The Python client sends a POST to a PHP file, which then prints it to show me that the POST is working, so I can move on to the next step of my development. However, for some reason, I can only post to it with an HTML5 form, and not Python 3.5.2 requests module.</p>
  
  <p>This is the PHP:</p>
  
  <pre><code>&lt;?php
  
  $data = ((!empty($_POST['data'])) ? $_POST['data'] : 'N/A');
  echo $data;
  
  ?&gt;
  </code></pre>
  
  <p>The Python:</p>
  
  <pre><code>    &gt;&gt;&gt; import requests
      &gt;&gt;&gt; url = "www.example.com/coords.php"
      &gt;&gt;&gt; data = "This is a string"
      &gt;&gt;&gt; r = requests.post(url, data)
      &gt;&gt;&gt; r.content
      b'N/A'
  </code></pre>
  
  <p>The HTML5 that works:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form method="post" action="www.example.com/coords.php"&gt;
              &lt;input type="text" name="data"&gt;
              &lt;input type="submit" name="submit"&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>