logpaste icon indicating copy to clipboard operation
logpaste copied to clipboard

Merge PUT handler into POST

Open mtlynch opened this issue 3 years ago • 0 comments

The PUT handler doesn't match the semantics of the traditional PUT verb.

I chose PUT because I wanted a way for the client to signal to the server that it wanted back the URL instead of a JSON object.

Revisiting the decision, I should have just used an Accept header in the request to let the client specify whether they want plaintext (default) or JSON. So we should combine the handlers for PUT and POST into a single handler that chooses output based on the content type and accept headers.

See similar work in PicoShare: https://github.com/mtlynch/picoshare/pull/318/files

mtlynch avatar Aug 17 '22 21:08 mtlynch