从python请求生成curl命令
rcurl的Python项目详细描述
RCURL
从请求生成curl语句的简单包。
目前支持的方法是有限的。检查usage
安装
pip install rcurl
用法
importjsonimportrequestsfromrcurlimportget_curlreq_one=requests.get("https://google.com")curl_command_one=get_curl(req_one)req_two=requests.post("https://google.com")curl_command_two=get_curl(req_two)data=json.dumps({'a':'b','x':45})headers={'content-type':'application/json','authorization':'Bearer dhsfdJGHGDH'}req_three=requests.post("https://google.com",data=data,headers=headers)curl_command_three=get_curl(req_three)print(curl_command_one)print(curl_command_two)print(curl_command_three)
构建
python setup.py bdist_wheel sdist twine upload dist/*