import json async def process(request): obj = json.loads(await request.text()) if 'message' in obj: return f'{obj["title"]} - {obj["message"]}' else: return obj['title']