|
-
June 5th, 2012, 11:00 AM
#1
AJAX call not including headers I specify
I have a javascript/jQuery function:
function getResponse() {
var currentDate = new Date();
var sendMessage = JSON.stringify({
SendTimestamp: currentDate,
Message: "Message 1"
});
$.ajax({
type: "POST",
url: "http://L45723:1802",
data: sendMessage,
headers: {
Accept: "text/x-json",
"Authorization": "Basic " + $.base64.encode("server:server123")
},
contentType: "text/x-json",
success: function (data) {
$('#_receivedMsgLabel').append(data.Message + '<br/>');
alert("ajax.success().");
getResponse();
},
async: true
});
}
However, when I check my server logs (and FireBug), this is the header I am sending in my request:
Host : l45723:1802
User-Agent : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
Accept : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language : en-us,en;q=0.5
Accept-Encoding : gzip, deflate
Connection : keep-alive
Origin : http://l45723
Access-Control-Request-Method : POST
Access-Control-Request-Headers : authorization,content-type
Pragma : no-cache
Cache-Control : no-cache
Why isn't my authorization stuff included in the header?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|