RFC 7231 suggests that a request with a missing
Accept header should be treated as
*/*, but hitting the API POST endpoint for a data explorer query without said header returns
406 Not Acceptable. I’m not sure if this is specific to data explorer or if it applies to other POSTs, too. All the other GETs I’ve used haven’t had this issue.
It so happens that
curl and Python’s
Accept: */* to all their requests by default, but not all tools do. You can see this behavior by disabling
curl's default with an empty header, e.g.,
curl -X POST "https://discourse.example.com/admin/plugins/explorer/queries/26/run" \ -H "Content-Type: multipart/form-data;" \ -H "Api-Key: <your_all_users_api_key>" \ -H "Api-Username: system" \ -H "Accept:"
Not a major thing, but it might be something that other tools hit, too… and it seems like it could be a simple fix, especially since all other endpoints I’ve used work without it.