Search code examples
pythonflaskherokujsonify

I don't know how to select specific items from jsonnified object in my web application using flask


response = requests.get(url)
response_json = response.json()
results = response_json['a'][0]
output = results['a_1'] + results['a_2'] + results['a_3']
return jsonify(output)

my output
"abcdefg"

what I want
abcdefg

I'm creating a web app using heroku and when I open the web application I want to return the output without "". I mean to display output without "".

How should I fix it?


Solution

  • Write

    return output
    

    instead of

    return jsonify(output)
    

    Returning a string returns a string without the quotes. Jsonifying returns a representation of JSON.