Q:

CORS issue in React js

I am using React js in front end and webApi (c#) for service side. Initially i got issue with CORS while trying to get data from db and then i have added the below lines in web.config file then the issue got resolved. I am able to get data from web api.
<customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Headers" value="Content-Type,Origin,Accept" />
        <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>

But now i am trying to post data, that is sending data from react js to web api, it is throwing the same cors error. please find the below lines from react js
fetch(url, {
    method: 'POST',
    mode:'cors',
    // body: JSON.stringify(data),
    // headers :{
    //   'Content-Type': 'application/json',
    //   'Access-Control-Allow-Origin':'*'
    // },
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json',
      'Access-Control-Allow-Origin':'*',
      'Access-Control-Allow-Headers':'Origin,Content-Type,Accept',

    }
  });

Is there anything i am missing. I dont understand why it is working for getting data and not for posting data. Any one can help me on this? 
Thanks in advance.

A:

i have installed Microsoft.AspNet.WebApi.Cors dll and the cors issue got resolved. Thanks all.

