我正在客户端使用 Extjs-6.0.0 开发一个应用程序。我在端口 80运行客户端应用程序。我的服务器端应用程序在端口 8084中运行。我想创建一个 Ajax 请求来向服务器发送请求,该请求具有以下属性:
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;
}
});
但这不起作用。我该怎么做?