http response is in json format

This commit is contained in:
Emmanuel Garette 2020-03-04 07:32:40 +01:00
parent 52824302d4
commit 299a9f52a0

View File

@ -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):