Changeset 6361 for sandbox/2.4.1-3/prototype
- Timestamp:
- 05/31/12 14:46:42 (12 years ago)
- Location:
- sandbox/2.4.1-3/prototype
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4.1-3/prototype/api/datalayer.js
r6351 r6361 259 259 //return this.send( this.dispatchPath + 'rest' + uri, [ 'get', accept || 'json' ], false, callback ); 260 260 //http://expressodev.prognus.com.br/cristiano/expresso-api/rest/maillast 261 return this.send( ('rest' + uri), [ 'get', accept || 'json' ], data, callback, !!!callback, 261 //return this.send( ('rest' + uri), [ 'get', accept || 'json' ], data, callback, !!!callback, 262 return this.send( (this.dispatchPath + '../rest' + uri), [ 'get', accept || 'json' ], data, callback, !!!callback, 262 263 {'beforeSend' : function (xhr){ 263 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}264 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + (DataLayer.me ? DataLayer.me.token : DataLayer.dispatch("../prototype/me").token))} 264 265 }); 265 266 … … 276 277 277 278 create: function( uri, data, callback, accept ){ 278 279 return this.send( 'rest' + uri, [ 'post', accept || 'json' ], data, callback, !!!callback, 280 {'beforeSend' : function (xhr){ 281 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} 282 }); 283 279 //return this.send( 'rest' + uri, [ 'post', accept || 'json' ], data, callback, !!!callback, 280 return this.send( (this.dispatchPath + '../rest' + uri), [ 'post', accept || 'json' ], data, callback, !!!callback, 281 {'beforeSend' : function (xhr){ 282 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} 283 }); 284 284 }, 285 285 … … 295 295 update: function( uri, data, callback, accept ){ 296 296 297 return this.send( 'rest' + uri, [ 'put', accept || 'json' ], data, callback, !!!callback, 297 //return this.send( 'rest' + uri, [ 'put', accept || 'json' ], data, callback, !!!callback, 298 return this.send( (this.dispatchPath + '../rest' + uri), [ 'put', accept || 'json' ], data, callback, !!!callback, 298 299 {'beforeSend' : function (xhr){ 299 300 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} … … 313 314 "delete": function( uri, callback, accept ){ 314 315 315 return this.send( 'rest' + uri, [ 'delete', accept || 'json' ], false, callback, !!!callback, 316 //return this.send( 'rest' + uri, [ 'delete', accept || 'json' ], false, callback, !!!callback, 317 return this.send( (this.dispatchPath + '../rest' + uri), [ 'delete', accept || 'json' ], false, callback, !!!callback, 316 318 {'beforeSend' : function (xhr){ 317 319 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} -
sandbox/2.4.1-3/prototype/rest/dispatch.php
r6357 r6361 38 38 // handle request, passing the current env baseUri and autoload mapping; 39 39 $request = new Request(array( 40 'baseUri'=> '/ tezza/expressoDFD/rest',40 'baseUri'=> '/gustavo/expressoDFD/rest', 41 41 'autoload' => $autoload, 42 42 ));
Note: See TracChangeset
for help on using the changeset viewer.