* console.log( data );
* } );
*
+ * Multiple values for a parameter can be specified using an array (since MW 1.25):
+ *
+ * var api = new mw.Api();
+ * api.get( {
+ * action: 'query',
+ * meta: [ 'userinfo', 'siteinfo' ] // same effect as 'userinfo|siteinfo'
+ * } ).done ( function ( data ) {
+ * console.log( data );
+ * } );
+ *
* @class
*
* @constructor
delete parameters.token;
}
+ for ( key in parameters ) {
+ if ( $.isArray( parameters[key] ) ) {
+ parameters[key] = parameters[key].join( '|' );
+ }
+ }
+
// If multipart/form-data has been requested and emulation is possible, emulate it
if (
ajaxOptions.type === 'POST' &&
'nomodule',
'mustbeposted',
'badaccess-groups',
- 'stashfailed',
'missingresult',
'missingparam',
'invalid-file-key',
'fetchfileerror',
'fileexists-shared-forbidden',
'invalidtitle',
- 'notloggedin'
+ 'notloggedin',
+
+ // Stash-specific errors - expanded
+ 'stashfailed',
+ 'stasherror',
+ 'stashedfilenotfound',
+ 'stashpathinvalid',
+ 'stashfilestorage',
+ 'stashzerolength',
+ 'stashnotloggedin',
+ 'stashwrongowner',
+ 'stashnosuchfilekey'
];
/**