- if ( options === undefined ) {
- options = {};
- }
-
- // make sure we at least have a URL endpoint for the API
- if ( options.url === undefined ) {
- options.url = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api' + mw.config.get( 'wgScriptExtension' );
- }
-
- this.url = options.url;
-
- /* We allow people to omit these default parameters from API requests */
- // there is very customizable error handling here, on a per-call basis
- // wondering, would it be simpler to make it easy to clone the api object, change error handling, and use that instead?
- this.defaults = {