从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/*

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
javascript通过WebSocket将服务器时间推送到多个客户端   这种java字节转换是如何工作的   数据库错误。sql。SQLEception:参数索引超出范围(1>参数数,为0)   java如何在搜索时过滤选定的viewpager片段中的recyclerview?   java如何使用OpenCV将图像转换为黑白图像并在ANDROID中消除阴影   Spring MVC项目中的java HTTP服务器状态404错误   Spring MVC中的java JSR303自定义约束验证器   java如何基于另一个ArrayList的值显示ArrayList中的特定项?   java如何在firebase messages节点获取最后发送给我的消息?   部署后在google app engine上运行servlet时发生java错误   java如何使用servlet在两个jsp之间发送数据   java日历年中的周是月中的周   从URL读取一个资源并直接返回这些字节作为REST请求的响应,Java 7和spring MVC 3.2不存储内存