Return Value

Your request can return a value. This return value will be printed to the terminal when you execute a request. It also gets returned when you use Recursive Calls. This can be useful for example for authentication.

Hint

The return value also get cached when Caching is implemented.

The Types that can be used are the same for arguments.

Secret Return Value

If your request returns Secret Type, it will be obfuscated in the terminal output:

Warning

DBGR will not obfuscate the value if it appears somewhere in request log, e.g. headers.*

from dbgr import request, secret

@request
async def get_jwt(session, username, password:secret) -> secret:
    res = await session.post(f'https://example.com/login', data={
        'username': username,
        'password': password
    )}
    data = return await res.json()
    return data['jwt']
$ dbgr r get_jwt
> POST https://example.com/login
< 200 OK
< Result (str):
  e******************c