title: POST with JSON works in Postman but not in Python
body: <p>Post with Json data is failing with python (both 2.7 or 3.6) throwing error "500 Internal server error" but works from Postman. Running python script from Windows 7 command prompt.</p>
  
  <pre><code>#!/usr/bin/env python
  import urllib
  import urllib2
  
  url = 'http://&lt;server&gt;:&lt;port&gt;/web/services/notes2'
  cont_type = 'application/json; charset=utf-8'
  user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36'
  values = {
      "LK_IN_BRANCH": "00123",
      "LK_IN_ACCOUNT": "12345678",
      "LK_IN_ENTRY_DATE": "20190315",
      "LK_IN_ENTRY_TIME": "12300111",
      "LK_IN_HOLD_DATE": "20190331",
      "LK_IN_EMP_INITS": "QTC",
      "LK_IN_COMMENT": "Comment from py script-notes2",
      "LK_IN_USER_ID": "Hxxxxxxx",
      "LK_IN_NOTE_GROUP": " "}
  headers = {
      "User-Agent": user_agent,
      "Content-Type": cont_type,
      "Accept": user_agent,
      "Accept-Encoding": "gzip, deflate"}
  
  try:
      data = urllib.urlencode(values)
      req = urllib2.Request(url, data, headers)
      response = urllib2.urlopen(req)
      json = response.read()
      print json
  except urllib2.URLError as e:
      if hasattr(e, 'reason'):
          print 'We failed to reach a server.'
          print 'Reason: ', e.reason
      if hasattr(e, 'code'):
          print 'The server couldn\'t fulfill the request.'
          print 'Error code: ', e.code
  </code></pre>
  
  <p>If I add "Content-Length" SAME as Postman receive "400 Bad request" error.
  <a href="https://i.stack.imgur.com/UgDP2.png" rel="nofollow noreferrer">POST request/response in Postman Console</a></p>
  
  <p>POST request works using 'Requests' 3rd party package from my machine but unfortunately actual environment could not have 'Requests' installed so need it to work with standard builtin python modules. Also python script with builtin modules for GET works without any problems. I would appreciate any help with issue.</p>