I removed all the try except block just simple code. Kindly guide me that will be really helpful for my project.
def download_file_data(presigned_url):
response = requests.get(presigned_url)
if response.ok:
json_content = response.json()
json_string = json.dumps(json_content)
file_path = os.path.join("/tmp", "swagger.json")
with open(file_path, "w") as file:
file.write(json_string)
return file_path