> GET /?key=key&val=value
GET is supposed to have no side effects, according to RFC2616 9.1.1.
> GET /?key=key&val=value
GET is supposed to have no side effects, according to RFC2616 9.1.1.
The "create a key-value pair" operation described here actually is idempotent.
The requirement on GET is that it must be safe, meaning no side-effects, for a variety of reasons, not just browser behaviour.
The difference is described in detail in RFC 7231 section 4.2, or the older RFC 2616 section 9.1.
The parent comment uses "safe" to mean doing it zero times is the same as doing it once or more. This is not a definition I've heard before, but maybe it's common in this context. A more normal term would be "free of side effects".
One way you might call modification time changes idempotent is if you don't care about modification times.
Another way is much subtler: Although an updated modification time represents a change, the point of HTTP idempotent requests is that repeating them automatically is harmless. This matters because some requests may be repeated automatically by some clients under some network conditions.[2] Updating the modification time twice to a near-current timestamp might satisfy the idempotency condition for the purposes of the application.
[1] This isn't as handwavy as it sounds. It means that because it's the application that determines whether the effects of a request count as "semantically" idempotent (or semantically safe), the application should choose the appropriate HTTP method (or "verb": GET, PUT, POST etc) for the application's needs. The application's choice of HTTP method matters because client libraries, proxies and servers perform different methods in different ways in the protocol.
[2] For example, if sent as the second or later request on a persistent HTTP/1.1 connection, just as the server closes the connection, then the client might retry any requests that are for an idempotent (or safe) method. So it may automatically retry GET, PUT and DELETE but not POST.
My point exactly :)
I'm no webdev, I think JS has been hyped so much around me I forgot plain html can actually do things...
When all API are GETs, the browser, which is likely to be open when you read this, is all you need.
An inline form on the webpage that POSTs the result is not a "webpage/separate tool". Option 2 would be to use the browser's dev console.
The dev console is a separate tool. And I'm still sure it is much quicker and easier to open a new tab and type in an URL, than to do a POST with dev console.
And your service is also incorrect due to the issues with side-effects mentioned elsewhere in the thread.
Multiple existing and established services were created as proofs-of-concept, silly jokes, experiments, and other "non-serious use" projects. Many of them have survived and we are forced to bear with their sloppy design all the time.
Have you ever used e.g. JavaScript?