News for hackers. Stuff that matters.
Re:Defining a new HTTP method: HTTP Search (2021) by austin-cheney on Saturday May 27, 2023 @01:05PM (#36096304)
I understand the benefits of QUERY over GET because GET is expected to return a resource in the response. Why not just use POST though? Send a post message to a server asking to conduct a search and sending the results of that query in the response?
Re:Defining a new HTTP method: HTTP Search (2021) by gabetax on Saturday May 27, 2023 @01:22PM (#36096451)
The biggest issue I've personally experienced is semantics when wrapping your head a design or debugging a service you aren't familiar with.

"POST" has come to imply a "write" operation, and mixing up the the reads and writes of a system leads to cognitive dissonance.

Re:Defining a new HTTP method: HTTP Search (2021) by dragonwriter on Saturday May 27, 2023 @04:06PM (#36097754)
QUERY is the one missing method to cover all reasonable combinations of safe/idempotent/neither and whether (if safety or idempotency applies) a body needs taken into account to identify a semantically identical request.

Not idempotent: POST

idempotent/not safe: PUT (body matters), DELETE (no body)

safe: QUERY (body matters)/GET (no body)

That’s why QUERY is needed. POST is not a good substitute.