I've been encountering a "Bad Request" error while attempting to make a POST request. I would greatly appreciate it if someone could point out where I may have gone wrong.
function mkSentiTopics() {
dta['n_clusters'] = 3;
$.ajax({
type: "POST",
url: "http://saxonydemoubuntu.southcentralus.cloudapp.azure.com/sentitopic",
data: JSON.stringify(dta),
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function(response) {
alert("success");
},
beforeSend: function() {
},
error: function(xhr, stats) {
alert("error");
}
});
}
The variable "dta" is in the form of a dictionary.
// dta["sentis"] consists of a list of numbers
// dta["texts"] consists of a list of strings
// dta["n_clusters"] is an integer value.