Closed sgoendoer closed 8 years ago
Why do we need to "HTTP POST /"? Would the "HTTP PUT /:guid" be enough for both creating and updating? This does match the definition of the verb: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
The idea was to have a more logical separation. Only using PUT would mean "create or update", while POST would mean "create only if it does not exist". Of course just using PUT (and GET and DELETE) would be sufficient
Do we need to discuss this further?
We were discussing it earlier and we're still thinking that PUT would be sufficient because the GUID is not generated, you have to explicitly declare it. That is, in the POST method you would have to send the GUID in the message to create the object.
Using the PUT method to "create and update" you define the GUID in the resource URL, i.e:
PUT /:guid
I would further add that the URLs should not start only with /. We are taking the whole address space, leaving none free for the future. Instead I would prefer to use the following URLs:
/guid/<guid>
@sgoendoer Regarding the DELETE, I like your alternative: use PUT to upload a version which is signed and marked as "inactive". It MUST BE impossible to change something that as been marked as "inactive". Eventually marking something as inactive could also remove the content. It would no longer map to anything.
Basically, I believe we should only have PUT and GET.
I guess we can close this?
Which interfaces do we need / want for the global registry to have?
First off, we need an interface for users to resolve a GUID Second, we need an interface for a user to upload a new set of data to the DHT Finally, we need an interface for a user to update his data in the DHT
Question: do we want to have an interface for deleting data?
Proposal:
Build the interface REST-style, i.e.:
will resolve the data.
will create a new entry in the DHT where the (signed) data needs to be specified in the request body
will update a dataset (by overwriting it). the (signed) data is again passed in the request body
will delete the dataset for the id :guid. not sure whether we should allow this. problem: no body can be passed via delete. alternative: use PUT to upload a version which is signed and marked as "inactive".