how to remove origin: file:// while doing rest call to server, via android app (created using phonegap/cordova)?

79 Views Asked by At

I am making an ajax call to server like below:

$.ajax({
          type : "POST",
          dataType : "json",
          url : url+ "/oms/rest/XYZ/anon/uvw/grantAbc",
          data : {
            "username" : username,
            "password" : password
          },

But on server side it's failing because origin:file:// getting sent with rest call.

requesr header

1

There are 1 best solutions below

0
Eric On

You cannot change the origin from file:// because you literally have no origin. The issue is that your REST back-end does not allow file:// as origin. You need to change that in your back-end.