I am trying to obtain login token from the Action API using Fetch in Javascript and encountering CORS issues. format=jsonp
works for all GET requests but not for obtaining tokens cross-site.
As providing sample code in Javascript on API docs came up in the recent survey results and we don’t support cross-site data modifying requests, I’m wondering:
a) What is the best way to demonstrate the use of a data-modifying operation via the Action API in Javascript?
b) What would be some possible options for documenting the use of API modules in Javascript? I am thinking maybe:
- Node.js (server-side)
- Fetch API (client-side)
- mediawiki.api.js (for gadget developers)
If I were to pick 1-2 out of these three options, which ones to pick? Any recommendation would be really helpful!