Good question.
If you want to create a new device, you would use POST.
If you want to know the state, you would use GET.
Within a RESTful service I would use PUT or PATCH for this action, because you want to modify something.
The browser doesn't know those commands, so I think you can use both.
RE: Why you should use POST instead of GET
You are viewing a single comment's thread from:
Why you should use POST instead of GET
Oh, I guess you misunderstood me. I meant changing the status of home devices with the PI.
For creating I also would prefer POST.
The GET method to "change the status" of my home devices (light on/off or open/close shutters) has proved its worth because i can bookmark it and i can call it via VBscript just by request the URL. Maybe I am too lazy.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Sure, i understood.
I said, the right command would be PUT or PATCH, because you want to modify the state. But you can only use GET or POST with the browser.
So both (GET and POST) would be ok...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit