I'm writing digest authorization in phonegap
This is my code
Setting Authorization header in ajax
This is my code
$.ajax({
type: "GET",
url: "http://10.0.2.2:9000/",
beforeSend : function(req) {
req.setRequestHeader('Authorization','Digest username="username", realm="' + realm + '", nonce="' + nonce + '", uri="/", response="' + response +'", opaque="' + opaque +'"');
}
});
I've already try using :
headers: { 'Authorization':'Digest username="username", realm="' + realm + '", nonce="' + nonce + '", uri="/", response="' + response +'", opaque="' + opaque +'"' }
but it's still doesn't work. is there any method to set header? or any method that we can check if the header had set or not?
thanks :)