Forum Discussion

Lewis_Beard's avatar
2 months ago
Solved

API Groovy HttpPatch?

Is it possible to do an HttpPatch, or to use the PATCH verb, when updating devices? I looked over on one of the LM pages for updataing devices with the API and as usual, most of the examples were in...
  • Stuart_Weenig's avatar
    2 months ago

    Up to personal preference at that point. It should work either way since you already have the object in memory. Technically, it’s a bit less efficient to do a PUT since you’re putting more data than what needs to be changed, but the PUT also doesn’t change anything if nothing needs to be changed. 

    I personally would do PATCH because that way i know my code is only touching the thing i want to change (easier to tell what the code is changing). PUT is technically more idempotent.