adlnet / xAPI-Spec

The xAPI Specification describes communication about learner activity and experiences between technologies.
https://adlnet.gov/projects/xapi/
907 stars 404 forks source link

Unspecified POST/PUT behavior on nonexistent document #1026

Closed TylerDixon closed 2 years ago

TylerDixon commented 7 years ago

Looking at 2.2 Document Resources section, there is talk of using POST to merge, and PUT to replace all together, but I can't find any specific details in there that say what to do in the case of a POST (or PUT).

There is a line stating: Content (PUT | POST): The document to be stored or updated., but describing both methods on the same line like this still feels non-specific and confusing.

I would assume for POST, the correct case is "create if doesn't exist" (respond 204), but I could see PUT could going either way, failing or not failing (204 or 404).

garemoko commented 7 years ago

There's definitely a lot of confusion around PUT vs POST for documents so we need more clarity.

In the particular case you mention, I the LRS is expected to store the document if it does not exist. I wouldn't expect PUT/ POST requests to the document API to ever return 404.

andyjohnson commented 7 years ago

Per the 2/1/17 call, clarify with response codes as needed for distinctions between PUT and POST.