title: Send HTTP Post with Python
body: <p>I want to make a program where I can send HTTP post requests and respond.</p>
  
  <p>So, I want to send THIS post:</p>
  
  <pre><code>POST https: //example.com/index.php?s=&amp;&amp;app=box&amp;module=ajax&amp;section=coreAjax&amp;secure_key=&amp;type=submit&amp;lastid=87311&amp;global=1 HTTP/1.1
  Host: example.com
  Connection: keep-alive
  Content-Length: 10
  Accept: text/javascript, text/html, application/xml, text/xml, */*
  X-Prototype-Version: 1.7.2
  Origin: https://example.com
  X-Requested-With: XMLHttpRequest
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
  Content-type: application/x-www-form-urlencoded; charset=UTF-8
  Referer: https://x.com/
  Accept-Encoding: gzip, deflate, br
  Accept-Language: en-US,en;q=0.8
  Cookie: cookieconsent_status=dismiss; 
  </code></pre>
  
  <p>And then enter the request body:</p>
  
  <pre><code>message=                    # Which I will make: "message= %s" % (messagex))
  </code></pre>
  
  <p>But I do not know how to send them and can´t seem to find any way online, could someone help please?</p>