PDA

View Full Version : Need Help with Ajax call using Architect 4



robzdoom
14 Aug 2017, 4:11 PM
Version:
4.2.2.282






Renderer:
56.0.2924.87




Platform:
1.6.2.49 - darwin x64






Cmd:
6.5.1.240




Framework:
Ext JS 6.5.x Classic




Hello, fellow Sencha Users. I recently started working with Sencha and fairly new with Architect 4. I am currently trying to get access in this data which requires a user email and password. I have a username and password I can use at this time. I am currently building a store using thr JSON Store from the store options.

I get this ERROR Message : Please make sure that the URL you set for your proxy is either local, or similar to the URL you set in your projects settings.

My URL prefix is: http://localhost:{port}/{path}


Ext.define('testIPA.store.MyJsonStore', { extend: 'Ext.data.Store',


requires: [
'testIPA.model.testModel',
'Ext.data.proxy.Ajax',
'Ext.data.reader.Json'
],


constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'MyJsonStore',
model: 'testIPA.model.testModel',
proxy: {
type: 'ajax',
url: 'https://brucetavernmanagement.com',
headers: '{\'Accept\': \'application/json\'}, \n{\'UserEmail\' : \'delvin773@gmail.com\'},\n{\'Password\' : \'testing\'}',
reader: {
type: 'json'
}
}
}, cfg)]);
}
});

Any help would be greatly appreciated since I've been stuck with this issue most of that day. Am I going to right direction, or do I need to approach this a different way.

Thanks for your help.

ssamayoa
17 Aug 2017, 8:54 AM
Looks like your "headers" property is bad defined, that's the reason SA shows that way, should be seen as JS array, surround headers in [].

Regards!