title: Python3: JSON POST Request WITHOUT requests library
body: <p>I want to send JSON encoded data to a server using only native Python libraries. I love requests but I simply can't use it because I can't use it on the machine which runs the script. I need to do it without.</p>
  
  <pre><code>newConditions = {"con1":40, "con2":20, "con3":99, "con4":40, "password":"1234"} 
  params = urllib.parse.urlencode(newConditions)
  params = params.encode('utf-8')
  
  req = urllib.request.Request(conditionsSetURL, data=params)
  urllib.request.urlopen(req)        
  </code></pre>
  
  <p>My server is a local WAMP server. I always get an</p>
  
  <blockquote>
    <p>urllib.error.HTTPError: HTTP Error 500: Internal Server Error</p>
  </blockquote>
  
  <p>I am <strong>100% sure</strong> that this is <strong>NOT</strong> a server issue, because the same data, with the same url, on the same machine, with the same server works with the requests library and Postman.</p>