Using the following code I am trying to pass a header to my POST request. (Note: urls masked)
file = sys.argv[0] url = sys.argv[1] conn = httplib.HTTPConnection("XX.XXX.XX.XXX",XXXX) headers = {'content-type':'application/xml'} conn.request("POST",url,file,headers) response = conn.getresponse() head = response.getheaders() status = response.status response = response.read() print response, status, head When I run this script and view the headers that get printed the following displays: [('content-length', '691'), ('proxy-connection', 'Keep-Alive'), ('connection', 'Keep-Alive'), ('pragma', 'no-cache'), ('cache-control', 'no-cache'), ('content-type', 'text/html; charset=utf-8')] Why isn't my content-type header using the value I pass in from headers?
-- http://mail.python.org/mailman/listinfo/python-list