Hello! Long-time lurker, and guilty dev behind the garage door. You can see the (broken) code I wrote here: https://github.com/wpearse/wemos-d1-garage-door-wifi I'll get around to fixing it later this week. Also, an apology: I should have used "side-effect-free" instead of "idempotent" in my tweets.
Fixed now: https://github.com/wpearse/wemos-d1-garage-door-wifi/commit/... I think. edit: updated link because left creds in the commit :-/
You know how HTTP GET requests are meant to be idempotent?
41–50 of 313 posts
Re: You know how HTTP GET requests are meant to be idempotent?
#42When I recently added 'click to unsubscribe' functionality to my emails, the URL got wrote out into some logs. Those logs got written to a Slack channel and Slack loves to click any link it sees. Oh, and it doesn't respect robots.txt. But all I saw was every member of my list clicking 'unsubscribe'. It took a good hour to figure out exactly what was going on. Idempotence is not the problem here, by the way. That just…
Re: You know how HTTP GET requests are meant to be idempotent?
#43Earlier quoted context omitted.
Fixed now: https://github.com/wpearse/wemos-d1-garage-door-wifi/commit/... I think. edit: updated link because left creds in the commit :-/
I hope that's not your real password!
Re: You know how HTTP GET requests are meant to be idempotent?
#44Earlier quoted context omitted.
“Toggle” is by definition not idempodent, because you get a different result each and every time. “Open” and “close” are idempodent, but not safe. The result of a GET request should always be idempodent and safe.
GET requests should have no side effects. In other words NOOP is idempotent
Get, and NOOP, are both "safe" and naturally "idempotent" since the former encompasses the latter.
Re: You know how HTTP GET requests are meant to be idempotent?
#45Hello! Long-time lurker, and guilty dev behind the garage door. You can see the (broken) code I wrote here: https://github.com/wpearse/wemos-d1-garage-door-wifi I'll get around to fixing it later this week. Also, an apology: I should have used "side-effect-free" instead of "idempotent" in my tweets.
Anything side-effect-free is idempotent too, I suppose
Re: You know how HTTP GET requests are meant to be idempotent?
#46Earlier quoted context omitted.
Fixed now: https://github.com/wpearse/wemos-d1-garage-door-wifi/commit/... I think. edit: updated link because left creds in the commit :-/
I hope that's not your real password!
Re: You know how HTTP GET requests are meant to be idempotent?
#47Earlier quoted context omitted.
It would be sufficient to GET a resource that uses a script to POST the side-effect. Slack's user-agent probably isn't sophisticated enough to mess this up (although heaven help us when they implement their preview with something like headless chrome).
What would the problem be in just showing a button that says "Confirm unsubscribe" that sends a POST request? A lot of sites does something like that for their newsletter unsubscription.
Re: You know how HTTP GET requests are meant to be idempotent?
#48Earlier quoted context omitted.
“Toggle” is by definition not idempodent, because you get a different result each and every time. “Open” and “close” are idempodent, but not safe. The result of a GET request should always be idempodent and safe.
GET requests should have no side effects. In other words NOOP is idempotent
Re: You know how HTTP GET requests are meant to be idempotent?
#49Earlier quoted context omitted.
> REST is HTTP This is untrue. I hate to quote from Wikipedia, but it sums it up quite nicely: "REST is not a standard in itself, but RESTful implementations make use of standards, such as HTTP, URI, JSON, and XML" More colloquially: REST is what happens when people mix up transport layers in their head.
HTTP is an implementation of REST.
Re: You know how HTTP GET requests are meant to be idempotent?
#50When I recently added 'click to unsubscribe' functionality to my emails, the URL got wrote out into some logs. Those logs got written to a Slack channel and Slack loves to click any link it sees. Oh, and it doesn't respect robots.txt. But all I saw was every member of my list clicking 'unsubscribe'. It took a good hour to figure out exactly what was going on. Idempotence is not the problem here, by the way. That just…