I am calling post web api method from angular but getting below error: "Failed to load : Response for preflight has invalid HTTP status code 404" I have enabled allow for cross origin request.
See below code:
return this._http.post("http://localhost:64575/api/Rules",
{
currentPage: 1,
pageSize: 10,
sortColumn: 'id',
sortDirection: 'asc'
}, requestOptions)
.map(res=>res.json());
Whenever you issue a Post request 2 calls are made to server
Now you need to handle "Options" call on your API implementation Reference link: Handling CORS Preflight in Asp.net Web API
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments