title: How use no-cors with fetch()
body: <p>I have a problem. I try to explain it.</p>
  <p>My client ask me to build a web portal for fetching and modifying data on private server, with Basic Auth.</p>
  <p>The private server return a XML files.</p>
  <p>I try using fetch() to get the data but I have a CORS error. I know what that mean but I don't have the hand on the private server.</p>
  <p>So I would like use my fetch() with :</p>
  <pre><code>mode : 'no-cors'
  </code></pre>
  <p>but if I use like that, I can use the data fetched.</p>
  <p>I think I have 2 main solutions:</p>
  <ul>
  <li>Add CORS support to the API you are using. This only works if you have control over the target.</li>
  <li>Instead of making the request from your domain, something else needs to make the request for you.</li>
  </ul>
  <p>If I can’t add CORS headers, I will likely want to build a small server-side script that can make these requests on my behalf.</p>
  <p>Instead of calling the target directly, my script can now call my script, which has to do the request for you server-side.</p>
  <p>But, if I don't have the hands on the server, how can I do that ?</p>
  <p>If someone have an idea...</p>
  <p>Thanks a lot...</p>
  <p>---- EDIT -----</p>
  <p>My code :</p>
  <pre><code>getListApps: async function () {
  
              let url = `${SA_BASE_URL}/applications`;
  
              // Set headers
              let headers = new Headers();
              headers.append('Authorization', 'Basic ' + btoa(SA_LOGIN + &quot;:&quot; + SA_PASSWORD));
              try {
                  // GET request
                  const response = await fetch(url, { 
                      method: 'GET', 
                      headers: headers, 
                      mode: 'no-cors', 
                      credentials: 'include' })
  
                  if (response.status === 200) {
                      const data = await response.json();
                      this.listApp = data;
                      this.listApp.forEach(app =&gt; {
                          if (app.status === &quot;DISCONNECTED&quot;) {
                              this.listDecApp.push(app);
                          }
                      });
                      this.nbr = this.listDecApp.length;
                  } else {
                      if (response.status === 400) this.errors = ['Invalid app_permissions value. (err.400)'];
                      if (response.status === 401) this.errors = ['Acces denied. (err.401)'];
                  }
              } catch (error) {
                  console.log(error);
                  this.errors = [&quot;Une erreur est survenue lors de la récupération des informations sur le serveur.&quot;]
              }
              
          },
  </code></pre>