Incrementing or decrementing a counter is neither side-effect-free nor idempotent, and GET should generally be both, so you really shouldn't use GET for those operations. [1]<p>POST would probably be the usual choice for these operations. (Though, since you aren't really creating a subresource but are instead performing a defined transformation on an existing resource, you could probably make a case for PATCH.)<p>Web APIs are protocols implemented on top of HTTP, and should respect the semantics of HTTP unless there is a clearly-identified compelling reason not to.<p>[1] <a href="http://tools.ietf.org/html/rfc2616#section-9.1" rel="nofollow">http://tools.ietf.org/html/rfc2616#section-9.1</a>
I was doing some usability testing in one of my webapps and needed a simple way to count conversions. There are lots of A/B testing solutions out there, but I just wanted a persistent count I could increment on specific user actions. So I created the ArbitraryCounter.com.<p>I find it useful, but I'm wondering if anyone else might. What do y'all think?<p>PS. This is WAY beta, and mainly a proof-of-concept. But I'll continue developing it if there's an interest it.
I think you should be able to incr/decr by more than 1. Maybe allow <a href="http://arbitrarycounter.com/vb/fruit/apples+N" rel="nofollow">http://arbitrarycounter.com/vb/fruit/apples+N</a> where N can be any integer > 0
GET should never modify data. I would recommend changing that to a POST before something indexes it and decides to crawl it every 5 minutes. See here for more reasons: <a href="http://stackoverflow.com/questions/705782/why-shouldnt-data-be-modified-on-an-http-get-request" rel="nofollow">http://stackoverflow.com/questions/705782/why-shouldnt-data-...</a><p>I realize this isn't supposed to be highly accurate, but it's something to keep in mind if it continues to grow.
I love simple api's like this. Its kind of the same mental model I keep around <a href="http://jsonip.com" rel="nofollow">http://jsonip.com</a>. A simple service that does one thing really well. Its been working well and has grown to millions of requests a day.<p>Keep working on this, I can see several uses already.
> All URLs are public. We recommend using a unique group name to avoid collisions with other users.<p>So anyone can increment your counter without you knowing? Seems like this means you can never rely on the count being right.<p>As a side note, the link on the bottom is broken.