The Headers post fine but the associated XML seems to be taken as string data only, XML is not processed. XML string is of the form:
params = <?xml version="1.0" encoding"="UTF-8 "?>
<MainRequest>
<requestEnvelope><errorLanguage>en_US</errorLanguage>
</requestEnvelope></MainRequest>
行动计划的形式如下:
enc_params = urllib.quote(params)
request = urllib2.Request("https://myURL/",enc_params, headers)
“XML”的发送形式如下:
%3C%3Fxml%20version%3D%221.0%22%20encoding%22%3D%22UTF-8%20%22%3F%3E%0A%3CMainReq
uest%3E%0A%3CrequestEnvelope%3E%3CerrorLanguage%3Een_US%3C/errorLanguage%3E%0A%3
C/requestEnvelope%3E
该错误信息表明XML的内容缺失。
任何想法都是有益的。