I have this python code from a service that fetches my database the 'responder' result. But I can not present this result, it only appears in this way '{"chickensAviary": "answer"}'
@route('/matematica3/naoAutomatica/get', method = "GET")
def matematica3NaoAutomaticaGet():
response.content_type = 'application/json;charset=utf-8'
cnx = mysql.connector.connect(host='**',
database='**', user='**',
password='**')
cnx_cursor1 = cnx.cursor(dictionary=True)
respostas = []
sql1 = "SELECT resposta FROM AprendeComigo.formulario where id_formulario=0;"
cnx_cursor1.execute(sql1)
l=cnx_cursor1.fetchone()
while l is not None:
matematica3NaoAutomaticaGet = { "galinhasAviario": l["resposta"]}
respostas +=[matematica3NaoAutomaticaGet]
l=cnx_cursor1.fetchone()
return json.dumps(respostas)