You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to upload a pdf file via python requests to a asset, it failes with error 422. I followed the guide on https://snipe-it.readme.io/reference/uploading-files and with curl it works, but when I use python requests, it won't work. Am I doing anything wrong here?
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Hello,
When I try to upload a pdf file via python requests to a asset, it failes with error 422. I followed the guide on https://snipe-it.readme.io/reference/uploading-files and with curl it works, but when I use python requests, it won't work. Am I doing anything wrong here?
Response:
HTTP 422: {"status": "error", "messages": "Invalid JSON", "payload":null}
What I have tried so far:
"file": open(file=file_name, mode="rb")
"file": open(file=file_name, mode="rb").read()
"file": f"{open(file=file_name, mode="rb").read()}"
"file[]": open(file=file_name, mode="rb").read()
"file[]": f"{open(file=file_name, mode="rb").read()}"
payload
parameter for requests.post()Some help would be really nice :)
Greetings, DasMoorhuhn
The text was updated successfully, but these errors were encountered: