From 299a9f52a0ffe7cb235bb91d8cf49066241bbd4f Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 4 Mar 2020 07:32:40 +0100 Subject: [PATCH] http response is in json format --- src/risotto/http.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/risotto/http.py b/src/risotto/http.py index b7162c8..aba434c 100644 --- a/src/risotto/http.py +++ b/src/risotto/http.py @@ -58,7 +58,8 @@ class extra_route_handler: raise HTTPInternalServerError(reason=str(err)) # await log.info_msg(kwargs['risotto_context'], # dict(request.match_info)) - return Response(text=dumps(returns)) + return Response(text=dumps(returns), + content_type='application/json') async def handle(request): @@ -84,7 +85,8 @@ async def handle(request): if get_config()['global']['debug']: print_exc() raise HTTPInternalServerError(reason=str(err)) - return Response(text=dumps({'response': text})) + return Response(text=dumps({'response': text}, + content_type='application/json')) async def api(request, risotto_context):