0
我使用Python的请求模块的一些数据发布到我公司的SharePoint网站:的Python填写POST数据空格用“+”
response = requests.post("https//my-sharepoint-site.com",
data={"myPost": "this is a test"},
auth=HttpNtlmAuth("\\MY_USER_NAME", MY_PASS))
对我公司的SharePoint网站产生后的样子:
myPost=this+is+a+test
我如何1)删除“myPost =”和2)停止用'+'填充空格?
注意:我无权访问公司的服务器端应用程序逻辑。
另一个说明:卷曲不用'+'编码空格。结果:
curl –f –v --ntlm –u MY_USER_NAME --data “this is a test” https://my-sharepoint-site.com
是:
this is a test
我的应用程序抛出415错误,当我做数据=“这是一个测试”.encode(“utf-8”) – Brinley
@Brinley:我不知道SharePoint或您的应用程序,但是你可能需要发送另一个标题。我会尝试'Content-Type:text/plain;字符集= UTF-8'。 –