我目前正在使用 WS,我向 url 发送 XML 请求,然后接收 XML 响应。该请求可能如下所示:
<RequestColour>
...
</RequestColour>
响应看起来像:
<ResponseColourOutput>
...
</ResponseColourOutput>
我应该在 Python 中使用哪些库来发送这些 xml 请求并接收返回的响应?
最佳答案
您可以使用 urllib2
Python 附带的模块,用于向可以使用它的 URL 发出请求。
The Python website has a decent tutorial on how to use this module to fetch internet resources.下一步是学习如何生成/使用 XML。
这些步骤的相关 SO 答案:
关于python - 如何在 Python 中发送 xml 请求和接收 xml 响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4660191/