I'm trying to send out the pwd & username to server to verify, using a POST method. I'm currently running on localhost
Here's my code:
$.ajax('/auth/', {
type: 'POST',
success: function(response) {
console.log("post success!");
},
headers: {'Authorization': 'Basic ' + window.btoa(username+":"+pwd_SHA1)},
error: function(jq, textStatus, errorThrown) {
console.log("post error");
}
});
The following are printed on the console:
OPTIONS /auth/
post error
With the call stack printed.
The server did not receive the request at all, thus errorThrown is empty string.
What is wrong here?