Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge PUT handler into POST #162

Open
mtlynch opened this issue Aug 17, 2022 · 0 comments
Open

Merge PUT handler into POST #162

mtlynch opened this issue Aug 17, 2022 · 0 comments

Comments

@mtlynch
Copy link
Owner

mtlynch commented Aug 17, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant