I have an application which is developed in 4.8 framework and another application .NET 8.0. The one in 4.8 is where I am developing the API’s and consuming in the other project. I added this in web.config but no luck. Initially I got it when I am using a GET call but after adding this it was good. But the same is not working for POST call so can some one let me know what changes I need to do
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
<add name="Access-Control-Allow-Methods" value="GET,POST,PUT,DELETE,OPTIONS" />
<add name="Access-Control-Allow-Credentials" value="true" />
</customHeaders>
Here is my controller
public class CustomerController : ApiController
{
[Route("api/process-all-ids")]
[HttpPost]
public async Task<IHttpActionResult> ProcessAllIds([FromBody] List<int> ids)
{
}
}