Please help me on this.
I am trying to connect to couchbase sync gateway using below ajax call with username and password but couldn't get any success. This username and password is already configured in the couchbase server.
However authentication is working fine when doing Ajax call for servlet and servlet in turn is connecting to couchbase sync gateway with the same username and password.
Can anyone please help in this username and password authentication on couchbase sync gateway using JQuery?I am using below code:$.ajax({
url: "http://<ip address:port number>/soyassist/_all_docs?include_docs=true",
type: 'GET',
username: "anurag",
password: "anurag",
dataType: 'jsonp',
contentType: 'application/json',
mimeType: 'application/json',
complete: function(data) {
alert(data);
alert(JSON.stringify(data));
//alert(data.total_rows);
},
error:function(data,status,er) {
alert("ERROR GETTING DATA FROM SERVER!");
// localread();
}
});