I'm developing an application using Extjs-6.0.0 in client side. I run client side application in port 80. My server side application running in port 8084. I want to create an Ajax request to send a request to server and this request have attributes as follow:
var json = {
"@class": "ir.javan.geoad.entity.Melk",
"title": "itsme",
"description": "Hi all",
"callPhone": "0912312312",
"address": "ya ali",
"accuracy": "MANTAQE",
"user": {
"email": "itsme.mm@gmail.com",
"name": "asdf",
"family": "asdf"
}
};
Ext.Ajax.request({
url: 'http://localhost:8084/GeoAd/ad/Add',
useDefaultXhrHeader: false,
method: "POST",
cors: true,
headers: {
"Content-Type": "application/json"
},
jsonData: json,
success: function(response){
text = response;
}
});
But this does not work. How can I do this?