Re:The HTTP QUERY Method specification
by paddw on Saturday May 27, 2023 @04:26PM
(#36097969)
This seems like it would introduce a tremendous amount of work to solve a problem that basically does not exist. You can just handle your POST request idempotently. We should just live with the semantics we have.
[ Parent
| on HN ]
did you even read the article? it describes why this is a bad idea — it’s not just your server that’s handling the request, it’s all the other middleboxes in between.
With POST, you can't know at a system level if it's safe to cache the response or not.
Re:The HTTP QUERY Method specification
by DaiPlusPlus on Saturday May 27, 2023 @04:33PM
(#36098026)
Cache-Control response headers?
Re:The HTTP QUERY Method specification
by preseinger on Saturday May 27, 2023 @06:20PM
(#36098962)
insufficient
> A cached POST response can be reused to satisfy a later GET or HEAD request. In contrast, a POST request cannot be satisfied by a cached POST response because POST is potentially unsafe; see Section 4 of [CACHING].
So if you are using POST to query, you can't cache the response. You have to resort to POST/GET. With QUERY, you have idempotent requests with cacheable responses you can directly return.
Cache-Control and Content -Location.
Re:The HTTP QUERY Method specification
by preseinger on Saturday May 27, 2023 @06:08PM
(#36098871)
HTTP defines the POST method explicitly as non-idempotent
It's definitely not a "tremendous" amount of work. At the bare minimum, you copy your POST code and change the verb, that's it. There's no need to cache, so you actually can handle it basically as idempotent POST.
> You can just handle your POST request idempotently
You actually can't though, and you don't usually have to look far to run into a case where this gives the wrong behavior. Better to just have a separate verb.
Idempotency and safety is about how to send POST requests, rather than how to handle them.
You can't pre-fetch a POST request, or re-try after a timeout. Because you have to consider that the POST request could have unintended consequences if sent too many times.
Re:The HTTP QUERY Method specification
by lacasito25 on Sunday May 28, 2023 @03:26AM
(#36101913)
That looks more of a documentation problem, rather than an HTTP problem.
You just document that that POST endpoint doesn't actually modify data.
A great example of this are OpenAI completions.