title: Making a Post request using Javascript Getting CORS Policy issue
body: <p>I've been trying to make a post request using the Postman API however I keep getting a CORS Policy Error. I can make a GET request to the API but I have really been struggling to make the POST request</p>
  
  <p><strong>How i make the call</strong></p>
  
  <pre><code>    var myHeaders = new Headers();
  
  myHeaders.append("X-Api-Key", "The relevant api key");
  
  myHeaders.append("Content-Type", "application/json");
  
  
  
  var raw = {
  
      collection: {
  
        variables: [],
  
        info: {
  
          name: "Sample Collection",
  
          description: "This is just a sample collection.",
  
          schema: "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
  
        },
  
        item: [
  
          {
  
            name: "This is a folder",
  
            description: "",
  
            item: [
  
              {
  
                name: "Sample POST Request",
  
                request: {
  
                  url: "echo.getpostman.com/post",
  
                  method: "POST",
  
                  header: [
  
                    {
  
                      key: "Content-Type",
  
                      value: "application/json",
  
                      description: ""
  
                    }
  
                  ],
  
                  body: {
  
                    mode: "raw",
  
                    raw: "{\n\t\"data\": \"123\"\n}"
  
                  },
  
                  description: "This is a sample POST Request"
  
                },
  
                response: []
  
              }
  
            ]
  
          },
  
          {
  
            name: "Sample GET Request",
  
            request: {
  
              url: "echo.getpostman.com/get",
  
              method: "GET",
  
              header: [],
  
              body: {
  
                mode: "formdata",
  
                formdata: []
  
              },
  
              description: "This is a sample GET Request"
  
            },
  
            response: []
  
          }
  
        ]
  
      }
  
  }
  
  
  
  var requestOptions = {
  
    method: 'POST',
  
    mode: 'cors',
  
    headers: myHeaders,
  
    body: raw,
  
    redirect: 'follow'
  
  };
  
  
  
  fetch("https://api.getpostman.com/collections", requestOptions)
  
    .then(response =&gt; response.text())
  
    .then(result =&gt; console.log(result))
  
    .catch(error =&gt; console.log('error', error));
  
  
  })
  
  </code></pre>
  
  <p><strong>The response back</strong></p>
  
  <pre><code>Access to fetch at 'https://api.getpostman.com/collections' from origin 'http://localhost:3000' has been blocked by CORS policy: 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.
  </code></pre>
  
  <p>I am able to make the call through Postman and works fine, just when doing it through the JavaScript I seem to be getting this error and i'm not sure why.</p>
  
  <p>Any help would be great</p>