$http.post(main+'/api/getcard/', $.param({number: $scope.searchcard}), {headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'} })
.then(function (response) {
if(response.data != 0)
{
$location.path('/redeem/'+response.data.id);
console.log(response.data);
}
});
Upon running the above code, my Chrome browser returns the following:
Request URL:http://cards.mporeda.pl/branch/api/getcard
Request Method:GET
Status Code:405 Method Not Allowed
However, when I run the same code on Laravel serve localhost:8000, I receive:
Request URL:http://localhost:8000/branch/api/getcard/
Request Method:POST
Status Code:200 OK
I have not made any additional $http configurations other than adding the header option in the request. There are no errors displayed in the console before this request, leading me to believe that the code is correct. Could there be an issue with my server or something else causing this discrepancy?