[英]Python equivalent of curl command
I got this command from a networking tutorial and I am hoping that I can use python
to automate it more easily later.我从网络教程中得到了这个命令,我希望以后可以使用
python
更轻松地自动化它。 The command is curl -sk -u admin:admin1 GET https://192.168.1.31/mgmt/tm/ltm/virtual
.命令是
curl -sk -u admin:admin1 GET https://192.168.1.31/mgmt/tm/ltm/virtual
。
What would be the exact equivalent of python
command of the curl
above?什么是上面
curl
的python
命令的确切等效项?
You can use the requests module for most of the commands as it is one of the most common web scraping module.您可以将 requests 模块用于大多数命令,因为它是最常见的 web 抓取模块之一。
You can refer to official documentary over here: Link您可以在这里参考官方纪录片:链接
And use this link to convert your curl into python, although it wont be accurate every time, but it will help you with initial cases.并使用此链接将您的 curl 转换为 python,虽然它不会每次都准确,但它会帮助您处理初始案例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.