Index: branches/uploadwizard/extensions/UploadWizard/resources/mw.Api.js |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | |
57 | 57 | // caller can supply handlers for http transport error or api errors |
58 | 58 | err: function( code, result ) { |
59 | | - var errorMsg = "API error: " + type + " : " + code; |
| 59 | + var errorMsg = "mw.Api error: " + code; |
60 | 60 | mw.log( errorMsg ); |
61 | 61 | }, |
62 | 62 | |
— | — | @@ -104,7 +104,8 @@ |
105 | 105 | * @param {Object|Function} ajax properties, or just a success function |
106 | 106 | */ |
107 | 107 | get: function( parameters, ajaxOptions ) { |
108 | | - ajaxOptions.type = 'get'; |
| 108 | + ajaxOptions = this.normalizeAjaxOptions( ajaxOptions ); |
| 109 | + ajaxOptions.type = 'GET'; |
109 | 110 | this.ajax( parameters, ajaxOptions ); |
110 | 111 | }, |
111 | 112 | |
— | — | @@ -116,7 +117,8 @@ |
117 | 118 | * @param {Object|Function} ajax properties, or just a success function |
118 | 119 | */ |
119 | 120 | post: function( parameters, ajaxOptions ) { |
120 | | - ajaxOptions.type = 'post'; |
| 121 | + ajaxOptions = this.normalizeAjaxOptions( ajaxOptions ); |
| 122 | + ajaxOptions.type = 'POST'; |
121 | 123 | this.ajax( parameters, ajaxOptions ); |
122 | 124 | }, |
123 | 125 | |
— | — | @@ -127,7 +129,6 @@ |
128 | 130 | * @param {Object} ajax properties |
129 | 131 | */ |
130 | 132 | ajax: function( parameters, ajaxOptions ) { |
131 | | - ajaxOptions = this.normalizeAjaxOptions( ajaxOptions ); |
132 | 133 | parameters = $j.extend( {}, this.defaults.parameters, parameters ); |
133 | 134 | ajaxOptions = $j.extend( {}, this.defaults.ajax, ajaxOptions ); |
134 | 135 | ajaxOptions.data = parameters; |