jquery - How to use CORS to access Flipkart API? -
i'm trying access below url using jquery ajax call..
ajax call
$.ajax({ type:"get", url: 'https://affiliate-api.flipkart.net/affiliate/report/orders/detail/xml?startdate=2015-05-01&enddate=2015-05-30&status=pending&offset=0', beforesend: function(xhr) { xhr.setrequestheader("fk-affiliate-id", "xxxxxx"); xhr.setrequestheader("fk-affiliate-token", "yyyyyyyyyyyyy"); }, success: function(data){ $('#response').html(data); } });
i'm getting below error..
cross-origin request blocked: same origin policy disallows reading remote resource @ https://affiliate-api.flipkart.net/affiliate/report/orders/detail/xml?startdate=2015-05-01&enddate=2015-05-30&status=pending&offset=0. (reason: cors header 'access-control-allow-origin' missing).
cross-origin request blocked: same origin policy disallows reading remote resource @ https://affiliate-api.flipkart.net/affiliate/report/orders/detail/xml?startdate=2015-05-01&enddate=2015-05-30&status=pending&offset=0. (reason: cors request failed).
Comments
Post a Comment