Roundy
Roundy

Reputation: 39

How to store a jsonify response into string variable

json_data2 = some_func(DB, pra1)
data = jsonify(result = json_data2)

I want to convert the "data" into a string variable, is there a convenient way?

Upvotes: 2

Views: 3859

Answers (1)

Robᵩ
Robᵩ

Reputation: 168586

The Response class has a get_data() accessor.

json_data2 = some_func(DB, pra1)
data = jsonify(result = json_data2)
print data.get_data(as_text=True)

Upvotes: 3

Related Questions