JSON data POST to Web API works in Fiddler but “Bad Request” error from JQuery AJAX -
i calling web api jquery ajax. (which run ajax local machine , calling web api server).
http://10.10.22.33:777/api/student/delstudentdetail?stuid=1
it working if manually call using fiddler.(response = 200)
but if call using jquery ajax, , fiddler capture 400 bad request (error = {"message":"the origin http://localhost:49983" not allowed."}) (if working if change 10.10.22.33 ip localhost)
here jquery code:
return $.ajax({ url: myurl, type: 'post', data: data, datatype: 'json', contenttype: "application/json; charset=utf-8", success: function (res) { mobileappspocdevextreme.app.navigate(navigateview); devexpress.ui.notify({ message: "modified successfully!" }, "success"); }, error: function (res) { devexpress.ui.notify({ message: "modification failed!" }, "error"); } });
i tried deploy web api local machine , working fine. please help.
Comments
Post a Comment