I've been trying to solve this problem for a while with no luck. I'm trying to get some odata with the following code:
Which seems like the right thing to do, given the other posts I've read on this subject. But when I actually look at what's going on using Tamper in Firefox, it sends an OPTIONS request. On the other hand, when I repeat the code used above WITHOUT the beforeSend part, it sends a GET request - but still no luck of course, because I can't authorize.
How do I get around it? (Here's a StackOverflow post I made for reference, complete with screenshots.)
var
dataSource =
new
kendo.data.DataSource({
dataType:
"odata"
,
transport: {
read: {
url:
"http://localhost:8080/odata/SDA/TEIID_TEST"
,
beforeSend:
function
(req){
req.setRequestHeader(
'Authorization'
,
'Basic dXNlcjp1c2Vy'
);
}
}
}
});
dataSource.read();
Which seems like the right thing to do, given the other posts I've read on this subject. But when I actually look at what's going on using Tamper in Firefox, it sends an OPTIONS request. On the other hand, when I repeat the code used above WITHOUT the beforeSend part, it sends a GET request - but still no luck of course, because I can't authorize.
How do I get around it? (Here's a StackOverflow post I made for reference, complete with screenshots.)