Curl转python在线工具

Curl转python在线工具[转]

我只是工具的搬运工
https://curl.trillworks.com/
复制到了我自己网站一份,备用链接
可以将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"}'

转化结果:

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)

github:https://github.com/NickCarneiro/curlconverter

你可能感兴趣的:(python-资源收藏)