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

Contradictions Around Alternate Request Syntax #1028

Open ahoran3 opened 7 years ago

ahoran3 commented 7 years ago

The rules around the alternate request syntax contradict with the example provided. In this example the URL contains a statementId query parameter in addition to the form parameter statementId.

From the Alternate Request Syntax section:

Any query string parameters other than "method" MUST instead be included as a form parameter with the same name.

The Learning Record Provider MUST NOT include any other query string parameters on the request.

Based on the rules above, I believe the example is incorrect and should instead read:

- URL: http://example.com/xAPI/statements?method=PUT&statementId=c70c2b85-c294-464f-baca-cebd4fb9b348
+ URL: http://example.com/xAPI/statements?method=PUT
Method: POST

Request Headers:
    Accept:*/*
    Accept-Encoding:gzip, deflate, sdch
    Accept-Language:en-US,en;q=0.8
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 745

Content (with added line breaks and not URL encoded for readability):
    statementId=c70c2b85-c294-464f-baca-cebd4fb9b348
    &Authorization=Basic VGVzdFVzZXI6cGFzc3dvcmQ=
    &X-Experience-API-Version=1.0.3
    &Content-Type=application/json
    &Content-Length=351
    &content={statement here...}
andyjohnson commented 7 years ago

Per the 2/1/17 call, @ahoran3 is correct and the example MUST be updated.