I am facing an issue fetching medicine information from TrueMD using the API. I have been trying to access it from my localhost, but despite including 'Access-Control-Allow-Origin' as null for web service security reasons, I am still encountering a security error. Is there something crucial that I might be overlooking?
$scope.medicines = [];
var search = "crocin";
var api_key = "API_KEY";
$http.get("http://www.truemd.in/api/medicine_suggestions?id=" + search + "?key=" + api_key)
.then(function(response){
response.header('Access-Control-Allow-Origin', "null");
$scope.medicines = response.data;
console.log($scope.medicine);
});