Convert curl commands to code

Curl转python在线工具[转]
我只是工具的搬运工
https://curl.trillworks.com/
复制到了我自己网站一份,
备用链接1
备用链接2
可以将curl命令转为python代码块
如:

curl --request POST    --url https://open.workec.com/auth/accesstoken    --header 'cache-control: no-cache'    --header 'content-type: application/json'  --data '{    "appId": appId,    "appSecret": "appSecret"}'
1
转化结果:

import requests
headers = {
    'cache-control': 'no-cache',
    'content-type': 'application/json',
}
data = '{\t"appId": appId,\t"appSecret": "appSecret"}'
response = requests.post('https://open.workec.com/auth/accesstoken', headers=headers, data=data)
1
2
3
4
5
6
7
github:https://github.com/NickCarneiro/curlconverter
————————————————
版权声明:本文为CSDN博主「janlyn06」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_43420032/article/details/84646041

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐