我正在尝试使用 Jquery 发送 Ajax POST 请求,但出现 400 错误请求错误。
这是我的代码:
$.ajax({
type: 'POST',
url: "http://localhost:8080/project/server/rest/subjects",
data: {
"subject:title":"Test Name",
"subject:description":"Creating test subject to check POST method API",
"sub:tags": ["facebook:work", "facebook:likes"],
"sampleSize" : 10,
"values": ["science", "machine-learning"]
},
error: function(e) {
console.log(e);
}
});
它说:无法从请求中构建资源。我错过了什么?