We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10e025a commit f241cd3Copy full SHA for f241cd3
src/client/delphi_epidata.py
@@ -72,9 +72,11 @@ def _request(params):
72
long and returns a 414.
73
"""
74
try:
75
- if "format" in params and params["format"]=="csv":
76
- return Epidata._request_with_retry(params).text
77
- return Epidata._request_with_retry(params).json()
+ result = Epidata._request_with_retry(params)
+ if params is not None and "format" in params and params["format"]=="csv":
+ return result.text
78
+ else:
79
+ return result.json()
80
except Exception as e:
81
return {'result': 0, 'message': 'error: ' + str(e)}
82
0 commit comments