News for hackers. Stuff that matters.
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.
Re:The HTTP QUERY Method specification by xrisk on Saturday May 27, 2023 @04:31PM (#36098008)
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.
Re:The HTTP QUERY Method specification by crooked-v on Saturday May 27, 2023 @04:31PM (#36098010)
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
Re:The HTTP QUERY Method specification by mnot on Saturday May 27, 2023 @09:55PM (#36100382)
Re:The HTTP QUERY Method specification by kortex on Sunday May 28, 2023 @01:06AM (#36101325)
> 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.

Re:The HTTP QUERY Method specification by mnot on Saturday May 27, 2023 @07:44PM (#36099602)
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
Re:The HTTP QUERY Method specification by kortex on Saturday May 27, 2023 @08:59PM (#36100068)
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.

Re:The HTTP QUERY Method specification by rocqua on Sunday May 28, 2023 @12:47AM (#36101220)
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.