-
Notifications
You must be signed in to change notification settings - Fork 23
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
Use POST instead of PUT #450
Comments
I don't have a well-formed view point here. I think from a protocol flow perspective the main thing we need is to be able to distinguish the initial message for an aggregation job (or collection job) with a continue (or poll) message. I think we already get this from media types but I'll check if/when we put a PR for this. cc/ @tgeoghegan |
Right. I think this generally should not be encoded in methods. |
Context? |
The semantic I focused on when I selected PUT for these requests is idempotence. I did consider doing the REST thing of transferring the entire representation of the resources in requests and responses, but concluded that this is quite wasteful in the aggregation sub-protocol: there's no reason for the helper to echo report shares and aggregation parameters back to the leader. That said, my main takeaway from having spent time on this during DAP-04 is that it doesn't really matter what methods we use because we don't expect DAP to be executed by a generic HTTP client (e.g. a web browser) but rather by dedicated DAP implementations. That means that it's not the end of the world if play a little fast and loose with method semantics. Long story short: I don't object to using different methods here. |
If what you are doing is asking for a change to a resource, rather than its replacement PATCH works over PUT. Idempotence is not guaranteed in that case, but it could be, depending on how you structure the request. The same applies to POST, which could be idempotent and therefore safe to retry with that knowledge. |
One alternate resolution: we could keep using the |
@divergentdave 's suggestion seems fine but I don't think we're getting anything out of the visibly idempotent behavior so we could just use POST. I would prefer this because
Which doesn't really make sense for report submission. It would also make more sense to use POST for job creation. |
This issue was discussed at IETF 118 but we did not reach a conclusion. The proposal was to keep the PUT, but add the report ID to the the resource URI. @mnot pointed out at the mic that "resources" always need a GET, which suggested to us that our attempts to define a "resource-oriented" API for DAP may have fallen short. I suggest we wait for @mnot's review of the draft before we take action here. |
Probably best to request a httpdir review. |
#532, once it lands, will remove the last reason (AFAIK) for collection job polling to use a POST rather than a GET. That PR will leave the POST in place for now, but collection job polling semantics may be worthy of review by the httpdir folks. |
RFC 9110 says:
As we are not replacing the resource at:
{leader}/tasks/{task-id}/reports
we should usePOST
The text was updated successfully, but these errors were encountered: