title: fetch() always results in "type: 'opaque'". But I can use Postman on my endpoint successfully
body: <p>I must be really terrible at JavaScript but I've been struggling with this for a few days and I've not made any progress.</p>
  
  <p>To make a long story short, I'm trying to work with UPS's REST API. I can do it with Postman and I can do it with PowerShell without any problems. JavaScript is a completely different story and I'm getting nowhere.</p>
  
  <p>I've tried both XMLHttpRequest and fetch() and I've tried so many different combinations of things I can't begin to list them all.</p>
  
  <p>Below is my JS function in my web app (it's triggered onchange of a field). The JS function makes a call to an Azure Function (the Azure Function works from Postman and from PowerShell.)</p>
  
  <pre><code>function getUpsShipTime() {
      var jsonBody = {
          "DeliveryDate": "2017-06-06",
          "ShippingCode": "GND",
          "ShipFrom": {
              "Address": {
                  "StateProvinceCode": "CA",
                  "CountryCode": "US",
                  "PostalCode": "90210"
              },
          },
          "ShipTo": {
              "Address": {
                  "StateProvinceCode": "FL",
                  "CountryCode": "US",
                  "PostalCode": "32830"
              }
          }
      }
  
      var uri = "https://MyAzureFunction.azurewebsites.net/api/HttpTriggerPowerShell1?code=MyAuthCode=="
  
      var req = new Request(uri, {
          method: 'post',
          mode: 'no-cors',
          headers: {
              'Content-type': 'application/json'
          },
          body: JSON.stringify(jsonBody)
      });
      fetch(req)
          .then(function (response) {
              console.log(response);
              return response.blob();
          }).then(function (blob) {
              console.log(blob);
          });
  }
  </code></pre>
  
  <p>When the function runs I get the following:</p>
  
  <p><a href="https://i.stack.imgur.com/IWvfE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IWvfE.png" alt="result of fetch() against my REST endpoint"></a></p>
  
  <p>Here's what I get from Postman:</p>
  
  <p><a href="https://i.stack.imgur.com/0CsPE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0CsPE.png" alt="REST call result from Postman"></a></p>
  
  <p>What am I doing wrong?</p>