1function HttpClient(api_base){ 2 this.api_base = api_base; 3}; 4 5HttpClient.prototype.request = function(url,method,fields,callback){ 6 7 switch(method.toUpperCase()){ 8 case "POST": 9 $.post(url,fields,function(data){ callback(data);}); 10 break; 11 case "GET": 12 default: 13 url = url+((fields!==undefined && fields!==null && fields!=='') ? '?'+fields : ''); 14 $.get(url,function(data){callback(data);}); 15 break; 16 } 17}; 18 19HttpClient.prototype.arrayToQs = function(params){ 20 var values = []; 21 for (var k in params){ 22 if($.isArray(params[k])){ 23 params[k] = JSON.stringify(params[k]); 24 } 25 values.push(k+"="+params[k]); 26 } 27 28 return values.join("&"); 29}; 30 31 32HttpClient.prototype.proxy = function(url,method,fields,callback,use_api_base){ 33 var self = this; 34 use_api_base = (use_api_base===undefined) ? true : use_api_base; 35 url = (use_api_base) ? self.api_base+url : url; 36 37 switch(method.toUpperCase()){ 38 case "POST": 39 fields += "&proxed_url="+encodeURIComponent(url); 40 41 $.post('/api/proxy.php',fields,function(data){ callback(data);}); 42 break; 43 case "GET": 44 default: 45 var qs = "?proxed_url="+encodeURIComponent(url); 46 47 $.get('/api/proxy.php'+qs,function(data){callback(data);}); 48 break; 49 } 50}; 51 52var httpclient = new HttpClient('http://api.makeitapp.com');
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.