Where will i place the Ajax.request codes?

Code:
 Ext.Ajax.request({
   url: 'http://www.mydomain.com/WebService/MyRequest',
   method: 'GET',
                
   callback: function(options, success, response) {
        console.log(response.responseText);
   }
 });