Manual:CORS

The main>Special:MyLanguage/API:Main page|MediaWiki API supports cross-origin resource sharing if   is enabled.

This is used on Wikimedia sites to do things like allow image uploads directly to Commons from Wikipedia sites on the mobile interface.

Some example code might look like:

A basic write API example: Note that  is part of the URL since POST CORS requests are preflighted and the origin parameter must be included in the preflight request.