Update app.py
Browse files
app.py
CHANGED
@@ -213,14 +213,12 @@ with st.container():
|
|
213 |
json_data = json.dumps(data)
|
214 |
headers = {'Content-Type': 'application/json'}
|
215 |
response = requests.get(RESPONSE_TXT_API,data=json_data, headers=headers)
|
216 |
-
print(response.text)
|
217 |
response_data = json.loads(response.text)
|
218 |
if response_data.get('status')=='success':
|
219 |
json_str =response_data.get("json")
|
220 |
-
json_str_formatted = json.dumps(json_str)
|
221 |
|
222 |
# Encode this JSON string to bytes, which is required for the download
|
223 |
-
json_bytes =
|
224 |
st.download_button(
|
225 |
label="Download JSON",
|
226 |
data=json_bytes,
|
|
|
213 |
json_data = json.dumps(data)
|
214 |
headers = {'Content-Type': 'application/json'}
|
215 |
response = requests.get(RESPONSE_TXT_API,data=json_data, headers=headers)
|
|
|
216 |
response_data = json.loads(response.text)
|
217 |
if response_data.get('status')=='success':
|
218 |
json_str =response_data.get("json")
|
|
|
219 |
|
220 |
# Encode this JSON string to bytes, which is required for the download
|
221 |
+
json_bytes = json_str.encode('utf-8')
|
222 |
st.download_button(
|
223 |
label="Download JSON",
|
224 |
data=json_bytes,
|