Here’s my source:
Tiles
Click Me!
The sendPostRequestWithAuth method is as follows:
function sendPostRequestWithAuth(url, params, auth, onComplete)
{
xmlHttpReq.open(“POST”, url, true);
xmlHttpReq.setRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”);
xmlHttpReq.setRequestHeader(“Content-Length”, params.length);
xmlHttpReq.setRequestHeader(“Authorization”, "OAuth " + auth);
xmlHttpReq.onreadystatechange = function() {
if(xmlHttpReq.readyState == 4 && xmlHttpReq.status == 200)
onComplete(xmlHttpReq.responseXML);
else if(xmlHttpReq.readyState == 4)
alert(xmlHttpReq.getResponseHeader(“oauth_token”) + xmlHttpReq.status);
};
xmlHttpReq.send(params);
}
Firefox initiates a preflight (because of the Authorization header, though it’s not documented), then I get a 403. What’s wrong?