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

POST vs PUT for create & IDs #32

Open
duglin opened this issue Oct 29, 2018 · 0 comments
Open

POST vs PUT for create & IDs #32

duglin opened this issue Oct 29, 2018 · 0 comments

Comments

@duglin
Copy link

duglin commented Oct 29, 2018

To register (or create) a new platform resource we do: POST /v1/platforms
and the ID of the platform is in the HTTP Body.

We can then later get info about that platform (or update it) via /v1/platforms/:ID.

  1. it seems to me that if we're going to have the client pass in the ID then it should be a PUT to the v1/platforms/:ID URL not a POST since POST is typically for when the server is going to decide things like the resource's ID and final URL.

  2. should the client pick the ID at all? What is the benefit of forcing the client to pick a globally unique value? Is it just for easy reference later on? If so, what is the benefit of using that ID as part of the URL? When we allow some other system to pick our unique IDs then we run the risk of them needing to change them later on - or (forever) maintain a mapping. E.g. what if they need to update the ID? I'm wondering if ID should just be a field of the resource but not part of the URL of the resource. Then clients can update the ID if they need to w/o the URL of the resource changing. Since we're not bound by the "brokers are stateless" constraints, we don't need to force the client to provide info on behalf of the server.

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