API endpoints

HTTP endpoints under /api/ are used to enumerate/iterate test URLs, report results for individual tests, and finally create a report for a whole session.

Get URL to run tests

POST /api/get

Parameters

Response

Redirects to a URL to run the tests, such as /tests/api/Node.

List tests

GET /api/tests

Parameters

Response

[
  "https://mdn-bcd-collector.gooborg.com/tests/api/Sensor",
  "http://mdn-bcd-collector.gooborg.com/tests/css/properties/dot-supports"
]

If there are no more tests an empty array is returned.

Report results

POST /api/results

The Content-Type should be application/json and the post body should be an array of test results:

[
  {
    "name": "api.Attr",
    "exposure": "Window",
    "result": true
  },
  {
    "name": "api.Blob",
    "exposure": "Worker",
    "result": null,
    "message": "[exception message]"
  }
]

Parameters

Response

Status 201 Created if the results were saved. The results are put in server-side session storage. Status 400 Bad Request is returned if the results do not match the expected format.

List results

GET /api/results

Response

{
  "https://mdn-bcd-collector.gooborg.com/tests/api/Sensor": {
    "some-data": "some-value"
  }
}

If no results have been reported to /api/results in this session then an empty object is returned.