How to get a feed from a password protected Discourse?

It seems that the fetching the rss with api key must specify a accepting header to fetch the right data.

  • If I fetch the rss without specifying the accept header like curl https://bbs.example.com/c/cat.rss?api_key=KEY could result to a < HTTP/1.1 404 Not Found page.
  • However, with specifying the accept-header, the xml for the rss could be fetched correctly. For instance:
curl 'https://bbs.example.com/c/cat.rss?api_key=KEY' \
  -H 'application/xhtml+xml' \