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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -