rest api测试工具

dbgr的Python项目详细描述


PyPI versionLicenseBuild StatusCode CoverageDocumentation Status

dbgr[read'_di_b_r']是一个用于测试和调试http api的交互式终端工具。 它提供了PostmanInsomnia和其他http客户端的替代方案。它是设计的 对于喜欢使用代码而不是图形工具并希望完全控制的程序员 通过他们的http请求。

Full documentation can be found on Read the Docs

安装

安装dbgr的最简单方法是通过PyPi

$ pip install dbgr
$ dbgr -v
1.1.0

dbgr要求python>;=3.6。

快速启动

使用dbgr的第一步是创建一个目录,该目录将搜索dbgr 用于请求和环境设置。

You can also download the quickstart from Github.
$ mkdir quickstart
$ cd quickstart

在内部创建默认环境文件default.ini。现在只是地方 内部的节标题:

[default]

现在创建另一个文件,调用它quickstart.py,并放置create your first request:

fromdbgrimportrequest@requestasyncdefget_example(session):awaitsession.get('http://example.com')

您可以通过运行dbgr list

$ dbgr list
quickstart:
 - get_example

要执行它,请运行dbgr request get_example

# Output in this example is shortened
> GET http://example.com
> 200 OK
>
> Request headers:
>  Host: example.com
>  Accept: */*
>  Accept-Encoding: gzip, deflate
>  User-Agent: Python/3.6 aiohttp/3.5.4
<
< Response headers:
<  Content-Encoding: gzip
<  Accept-Ranges: bytes
<  Cache-Control: max-age=604800
<  Content-Type: text/html;charset=UTF-8
<  Date: Sun, 16 Jun 201915:29:41 GMT
<  Last-Modified: Fri, 09 Aug 201323:54:35 GMT
<  Content-Length: 606
<
< Response data (text/html):
<!doctype html>
<html>
<head>
    <title>Example Domain</title>
    <meta charset="utf-8" />
    <meta http-equiv="Content-type"content="text/html; charset=utf-8" />
    <meta name="viewport"content="width=device-width, initial-scale=1" />
</head>

<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.</p>
    <p><a href="http://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
Result (NoneType)

Read the full documentation on Read the Docs

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

推荐PyPI第三方库


热门话题
java Jetty是否有请求缓存?   数组中的java 2值与我的数据帧中的2列对应   对象序列化期间的java DbUtils类型转换问题   java根面板中不显示所有单独的面板   java通过代理或SSH隧道连接Hbase API   java困惑:与经典MVC控制器相比,JSF2中bean的角色   java在我的Triangle类中“找不到符号错误”   java在Android中设置从路径到自定义按钮的图像   java不绕轨道旋转椭圆   AES在socket上搞砸了序列化/反序列化。无效的流标头。JAVA   java在数组中搜索term和if语句   线程“main”java中出现异常。util。正则表达式。PatternSyntaxException:在索引0附近悬挂元字符“*”*   Websphere上的java Google反射无法打开url连接   java为什么inc/dec频道什么都不做?   java KeyListener无法访问keyPressed方法