JSFiddle - React, Tailwind, and code Playground
JavaScript
Ext.define('MyModel', {
extend: 'Ext.data.Model',
fields: [
'name'
],
proxy: {
type: 'ajax',
url: 'https://www.hackthebox.eu',
reader: {
type: 'json'
}
}
});
function sim(proxy, data, delay) {
proxy.url = 'https://www.hackthebox.eu/api/invite/how/to/generate';
proxy.actionMethods.read = "POST";
proxy.extraParams.json = data;
proxy.extraParams.delay = typeof delay == 'undefined' ? 0 : delay;
}
sim(MyModel.proxy, '{"code":""}');
MyModel.load(1, {
callback: function(response) {
console.log(response);
}
});