-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update method #25
Comments
Hello @skreu I've tested it and I can confirm there is a problem. When calling an update for an Entity, the response is HTTP 200 but there is no data in it (it should return a JSON document). As the code use the json() method on the response from requests.Response on an empty response it crashes with the JSONDecodeError error. When using curl, it doesn't work either (you get a 200 return code but with no content and the entity is not updated):
From GLPI point of view, I looked at the logs of my test instance, and I have this error when I make a call:
And when I comment the PHP code directly in my Docker test instance, it does work:
(it works but for entities other than the root, I get a permission error, but this is probably another thing) This seems to be a problem with GLPI and I don't know if I should do something in the library. I could check if the response is empty to prevent the JSONDecodeError, but the call still do nothing (should I raised an error ?). And I don't want to manage every quirks of the GLPI API (which has a lot of weird behaviors). Let me know what you think. |
Hi !
First of all, thank you very much for your work.
I can't sort out why i get an error.
Everything works fine except since I upgraded my GLPI instance.
Useful informations :
glpi-api-0.4.0 (trying to update to 0.5.0 to test)
requests-2.31.0 (updating as well)
GLPI 10.0.16
When i use this :
myinstance.api.update("Appliance", {"id":1, "name": "Myname"}) works beautifully...
if i try the exactly same but with Entity, let's say for example :
myinstance.api.update("Entity", {"id":1, "tag": "homeentity"}) i get a JSONDecodeError.
wasn't doint that before my upgrade (quite old @ GLPI10.0.6)
Response is completely empty, hence the error.
But if i try with curl in the terminal, everything works fine. Can't explain why.
I'm updating the packages today, and come back for more informations.
The text was updated successfully, but these errors were encountered: