When I submit an update given my data source, it generates the following HTTP request. Note the TEIID_TEST(2M) part - it should just be 2, corresponding to a numeric ID of 2:
Here's my code:
<script type="text/javascript">
jQuery.support.cors = true;
var call = $.ajax({
url: "http://amr-dsiprod05:8080/odata/SDA/TEIID_TEST",
type: "GET",
headers: {
Authorization: "Basic dXNlcjp1c2Vy"
},
dataType: "json",
success: function(data){
var results = data.d.results;
var len = results.length;
var text = '<p>Successfully fetched ' + len + ' rows from the database</p>';
$('#RESULT').html(text);
},
error: function(err){
//alert(err.statusText);
$('#RESULT').html('<p>Failed to fetch data due to ' + err.statusText);
}
});
call.done(function (data, textStatus, jqXHR) {
$('#example').dataTable({
"bDestroy": true,
"bProcessing": true,
"aaData": data.d.results,
"aoColumns": [
{ "mData": "NAME" },
{ "mData": "FAVORITE_COLOR" },
{ "mData": "ID" }
]
});
});
call.fail(function (jqXHR,textStatus,errorThrown){
alert("Error retrieving Tasks: " + jqXHR.responseText);
});
</script>
Thoughts? Why does the M appear?
PUT http://amr-dsiprod05:8080/odata/SDA/TEIID_TEST HTTP/1.1
Content-Type: application/json
Accept-Language: en-us
Authorization: Basic dXNlcjp1c2Vy
Accept: application/json, text/javascript, */*; q=0.01
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MS-RTC LM 8)
Host: amr-dsiprod05:8080
Content-Length: 147
Connection: Keep-Alive
Pragma: no-cache
{"__metadata":{"uri":"http://amr-dsiprod05:8080/odata/SDA/TEIID_TEST(2M)","type":"SDA.TEIID_TEST"},"NAME":"test","FAVORITE_COLOR":"Blues","ID":"2"}
Here's my code:
<script type="text/javascript">
jQuery.support.cors = true;
var call = $.ajax({
url: "http://amr-dsiprod05:8080/odata/SDA/TEIID_TEST",
type: "GET",
headers: {
Authorization: "Basic dXNlcjp1c2Vy"
},
dataType: "json",
success: function(data){
var results = data.d.results;
var len = results.length;
var text = '<p>Successfully fetched ' + len + ' rows from the database</p>';
$('#RESULT').html(text);
},
error: function(err){
//alert(err.statusText);
$('#RESULT').html('<p>Failed to fetch data due to ' + err.statusText);
}
});
call.done(function (data, textStatus, jqXHR) {
$('#example').dataTable({
"bDestroy": true,
"bProcessing": true,
"aaData": data.d.results,
"aoColumns": [
{ "mData": "NAME" },
{ "mData": "FAVORITE_COLOR" },
{ "mData": "ID" }
]
});
});
call.fail(function (jqXHR,textStatus,errorThrown){
alert("Error retrieving Tasks: " + jqXHR.responseText);
});
</script>
Thoughts? Why does the M appear?