HomePhabricator

mediawiki.api: Add parameter ajaxOptions to postWithToken()

Authored by Fomafix.

Description

mediawiki.api: Add parameter ajaxOptions to postWithToken()

This allows to upload a file with token.

var api = new mw.Api();
api.postWithToken(
'edit',
{

		action: 'upload',
		format: 'json',
		filename: 'Foobar.png',
		file: file

},
{

		contentType: 'multipart/form-data'

}
);

Change-Id: I7a0fec3c1ef2c7881d4c04b1a9dd44fac02cb346