Hello everybody:
I'm currently testing KendoUI in order to adopt it for new developments and I have two big problems with the ajax request. You can download a complete solution from https://github.com/ragare62/AriUserManagement in order to test this behaviour. If you load AriUMSolution and start AriUMWebApi and AriUMWebHtml (UserGroupGrid.shtml) you'll access to a Kendo grid page and try to create, update or delete registers.
PUT and DELETE http verbs don't work:
When I specify the "type" attribute in "transport.create" to "POST", "transport.update" to "PUT" and "transport.destroy" to "DELETE" the result is always a request with the "OPTIONS" verb. Reading the JQuery documentation about ajax request I realize that "PUT" and "DELETE" could be problematic. Well, I said to myself I'll work only with "POST" so far, and then it came the second problem.
When change "contentType" the request doesn't work:
In my example when you create a new register a "POST" request is issued but webapi can't deserialize the JSON object in the request body. When I debugged that problem with Fiddler I realized that the Content-Type was "Content-Type: application/x-www-form-urlencoded; charset=UTF-8", if I changed "application/x-www-form-urlencoded" to "application/json" with Fiddler everything worked fine. I tried to fix the content type in "transport.create" with the "contentType" attribute to "application/json". But if I did that, the http verb changes from "POST" to "OPTIONS".
I tested these issues with "html" pages instead of "shtml" pages and with different browsers with the same result.
Any help would be appreciate.
Thanks in advance.
I'm currently testing KendoUI in order to adopt it for new developments and I have two big problems with the ajax request. You can download a complete solution from https://github.com/ragare62/AriUserManagement in order to test this behaviour. If you load AriUMSolution and start AriUMWebApi and AriUMWebHtml (UserGroupGrid.shtml) you'll access to a Kendo grid page and try to create, update or delete registers.
PUT and DELETE http verbs don't work:
When I specify the "type" attribute in "transport.create" to "POST", "transport.update" to "PUT" and "transport.destroy" to "DELETE" the result is always a request with the "OPTIONS" verb. Reading the JQuery documentation about ajax request I realize that "PUT" and "DELETE" could be problematic. Well, I said to myself I'll work only with "POST" so far, and then it came the second problem.
When change "contentType" the request doesn't work:
In my example when you create a new register a "POST" request is issued but webapi can't deserialize the JSON object in the request body. When I debugged that problem with Fiddler I realized that the Content-Type was "Content-Type: application/x-www-form-urlencoded; charset=UTF-8", if I changed "application/x-www-form-urlencoded" to "application/json" with Fiddler everything worked fine. I tried to fix the content type in "transport.create" with the "contentType" attribute to "application/json". But if I did that, the http verb changes from "POST" to "OPTIONS".
I tested these issues with "html" pages instead of "shtml" pages and with different browsers with the same result.
Any help would be appreciate.
Thanks in advance.