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 abbd111 commit 12b6a50Copy full SHA for 12b6a50
quickchart/__init__.py
@@ -10,6 +10,8 @@
10
# For Python 3
11
from urllib.parse import urlencode
12
13
+USER_AGENT = 'quickchart-python (1.0.0)'
14
+
15
FUNCTION_DELIMITER_RE = re.compile('\"__BEGINFUNCTION__(.*?)__ENDFUNCTION__\"')
16
17
@@ -89,7 +91,10 @@ def _post(self, url):
89
91
}
90
92
if self.key:
93
postdata['key'] = self.key
- resp = requests.post(url, json=postdata)
94
+ headers = {
95
+ 'user-agent': USER_AGENT,
96
+ }
97
+ resp = requests.post(url, json=postdata, headers=headers)
98
if resp.status_code != 200:
99
raise RuntimeError(
100
'Invalid response code from chart creation endpoint')
0 commit comments