python - Python 中的 CURL 替代方案

标签 python curl

我有一个在 PHP 中使用的 cURL 调用:

curl -i -H 'Accept: application/xml' -u login:key "https://app.streamsend.com/emails"

我需要一种在 Python 中做同样事情的方法。在 Python 中是否有 cURL 的替代方法?我知道 urllib 但我不知道如何使用它。

最佳答案

您可以使用 Requests图书馆。安装它

pip install requests

您可以在 https://requests.readthedocs.io/en/latest/ 找到它的文档。

关于python - Python 中的 CURL 替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2667509/

相关文章:

python - 如何在两个数据框中查找匹配项

python - 将python中生成的图像存储到Django数据库(MySQL)

python嵌套字典: OrderedDict from collections

linux - Powershell POST 到 Linux curl

curl - 如何在 yml 中运行 curl 请求

bash - 如何使用脚本创建一个到 Stratum 的套接字?

linux - 滥用cURL与Redis通信

python - 如何将嵌套列表中的值转换为集合?

python - 我怎样才能制造多重不等式?

带有 Curl : follow redirect with POST 的 PHP