REST API testing tool


Keywords
api, rest, testing, http, http-client, python, python3, rest-api, terminal, testing-tools, tool
License
Apache-2.0
Install
pip install dbgr==1.3.0

Documentation

DBGR: HTTP client that gives you full control

PyPI version License Build Status Code Coverage Documentation Status

Dbgr [read 'ˌdiːˈbʌɡər'] is a interactive terminal tool to test and debug HTTP APIs. It offers alternative to Postman, Insomnia and other HTTP clients. It is designed for programmers that prefer to use code instead of graphical tools and want full control over their HTTP requests.

Full documentation can be found on Read the Docs

Features

DBGR Basic Usage Example

Installation

The easiest way to install DBGR is via PyPi:

$ pip install dbgr
$ dbgr -v
1.1.0

DBGR requires Python >=3.6.

Quick Start

First step when working with DBGR is to create a directory which will DBGR search for requests and environment settings.

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

Inside create your default environment file default.ini. For now just place a section header inside:

[default]

Now create another file, call it quickstart.py and place create your first request:

from dbgr import request

@request
async def get_example(session):
    await session.get('http://example.com')

You can check that DBGR registered the request by running dbgr list:

$ dbgr list
quickstart:
 - get_example

To execute it, run 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 2019 15:29:41 GMT
<  Last-Modified: Fri, 09 Aug 2013 23: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