title: How to How to fix "No 'Access-Control-Allow-Origin' header is present on the requested resource" in post call in reactJS using Fetch method
body: <p>Getting below error while i call DotNet core API method from ReactJS post call using Fetch options.</p>
  
  <ul>
  <li><p>ReactJS post call only i am getting this error, below way i was tried.</p>
  
  <ul>
  <li>Jquery get/post request   - working fine</li>
  <li>Postman get/post  request - working fine</li>
  <li>Swagger get/post  request - working fine</li>
  <li>ReactJS get request       - working fine</li>
  <li><strong>ReactJS post request      - Not working fine</strong></li>
  </ul></li>
  </ul>
  
  <p>"Access to fetch at '<a href="https://localhost:44352/api/Address/CheckAvailability" rel="nofollow noreferrer">https://localhost:44352/api/Address/CheckAvailability</a>' from origin '<a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled."</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>/*ReactJS Code: */
  
  export function saveAddress(address) {
     return fetch(baseURL + "Address/CheckAvailability", {
      method: "POST",
      headers: {
        "Access-Control-Allow-Origin": "*",
        'Content-Type': 'application/json',
        'Accept': 'application/json'
      },
      body: JSON.stringify(address),
    }).then(handleResponse)
      .catch(handleError);
  }
  
  
  /*Dot.Net core Code: */
  [HttpPost]
  public ActionResult CheckAvailability([FromBody]ReqAddressDetailsDto request)
  {
  
    if ((request) == null)
      {
        return NotFound();
      }
    return Ok(request);
  }</code></pre>
  </div>
  </div>
  </p>