-2
下面是curl命令,並希望在python中使用請求。我是python的初學者。欣賞建議/幫助。如何在python下使用curl命令
捲曲--header '內容 - 類型:文本/ XML;字符集= UTF-8' --data二進制@c:/abcd.xml -X POST http://www.dneonline.com/calculator.asmx
下面是curl命令,並希望在python中使用請求。我是python的初學者。欣賞建議/幫助。如何在python下使用curl命令
捲曲--header '內容 - 類型:文本/ XML;字符集= UTF-8' --data二進制@c:/abcd.xml -X POST http://www.dneonline.com/calculator.asmx
可以使用requests模塊或從shell中調用它。 因此,
from subprocess import call
call("curl --header 'Content-Type: text/xml;charset=UTF-8' --data-binary @c:/abcd.xml -X POST",shell=True)
您是否需要更多解釋?我建議你upvote和[接受](https://meta.stackexchange.com/a/5235/344471)我的答案。 –