Python curl封装,受micha/resty启发
项目描述
#pyresty
`pyresty` 是一个由 [micha/resty](http://github.com/micha/resty) 启发的 requests 封装。它提供了一个简单、简洁的shell界面来与 REST 服务交互。
。
## 快速开始
根据您的喜好安装 pyresty。我推荐 `pip`。
```
$ pip install pyresty
```
将主机添加到配置(即将添加的ad-hoc主机)
```
$ pyresty add localhost http://localhost:8000/v2.0
```
将全局主机设置为您的目标
```
$ pyresty localhost
```
发出请求
```
$ GET /things
{[{"id": 1, "name": "superwidget"}, {"id": 2, "name": "not_cool_widget"}]}
$ DELETE /things/1
```
如果您想切换主机
```
$ pyresty production_server
```
## 即将推出功能
* ad-hoc主机定义:`pyresty http://random.com`
* 会话录制和回放
* 从环境中加载令牌
* 身份验证插件
* 具有更多选项的主机部分
* 输出选项
* vi集成
`pyresty` 是一个由 [micha/resty](http://github.com/micha/resty) 启发的 requests 封装。它提供了一个简单、简洁的shell界面来与 REST 服务交互。
。
## 快速开始
根据您的喜好安装 pyresty。我推荐 `pip`。
```
$ pip install pyresty
```
将主机添加到配置(即将添加的ad-hoc主机)
```
$ pyresty add localhost http://localhost:8000/v2.0
```
将全局主机设置为您的目标
```
$ pyresty localhost
```
发出请求
```
$ GET /things
{[{"id": 1, "name": "superwidget"}, {"id": 2, "name": "not_cool_widget"}]}
$ DELETE /things/1
```
如果您想切换主机
```
$ pyresty production_server
```
## 即将推出功能
* ad-hoc主机定义:`pyresty http://random.com`
* 会话录制和回放
* 从环境中加载令牌
* 身份验证插件
* 具有更多选项的主机部分
* 输出选项
* vi集成