0

I am hitting an open source API (to make an angular app) which has CORS enabled. I used chrome extension Allow-Control-Allow-Origin:* but only able to do GET requests. While doing POST, PUT and DELETE, the api call is done with OPTIONS and 404 error is coming. Please help.

1 Answers1

0

Can you try to access you API with the custom headers as like sample given below,

var sampleAPI= {
   method: 'POST',
   url: sample-api,
   data: youData,
   headers: {
      'Accept':'*/*',
      'Content-Type':'application/json'
   }
};

$http(sampleAPI).then(function (data) {
    //some success result
}, function(data){
    //some failure result
});
Immanuel Kirubaharan
  • 1,084
  • 1
  • 11
  • 17