This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
HTTP Error 400: Bad Request #279
Answered
by
jnsougata
SlumberDemon
asked this question in
Help
-
code: def upload():
with open('src/eightball/responses.json', 'r') as f:
rsp = json.load(f)
num = 0
while True:
num+=1
print(num)
base.put({'item': [rsp[f"{num}"]]}, key=num)
if num == 55:
break error base.put({'item': [rsp[f"{num}"]]}, key=num)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/deta/base.py", line 152, in put
code, res = self._request("/items", "PUT", {"items": [data]}, content_type=JSON_MIME)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/deta/service.py", line 85, in _request
raise urllib.error.HTTPError(url, status, res.reason, res.headers, res.fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request |
Beta Was this translation helpful? Give feedback.
Answered by
jnsougata
Jun 17, 2022
Replies: 1 comment
-
first of all the parameter |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
SlumberDemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
first of all the parameter
key
should be a string…In your case you gave an integer as key… ig the issue occurred from there