title: Http failure response for (unknown url): 0 Unknown Error
body: <p>I'm currently developing a service-based system and having some problems with the http requests(seems to be a problem with CORS - Cross origin resource sharing).</p>
  
  <p>The API where I'm sending the request is written in PHP, with the Slim framework and I'm actually enabling CROS with the following code:</p>
  
  <pre><code>$app-&gt;add(function ($req, $res, $next) {
      $response = $next($req, $res);
      return $response
              -&gt;withHeader('Access-Control-Allow-Origin', '')
              -&gt;withHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, Accept, Origin, Authorization')
              -&gt;withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, PATCH, OPTIONS');
  });
  </code></pre>
  
  <p>But when I send requests from the front-end(written with Angular):</p>
  
  <pre><code>this.http.get(this.base_url + "api/users/")
      .subscribe(
          (data) =&gt; {
              console.log(data);
          },
          (error) =&gt; {
              console.log(error);
      });
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>name:"HttpErrorResponse"
  
  message:"Http failure response for (unknown url): 0 Unknown Error"
  </code></pre>
  
  <p>The two projects are running in Docker, if that's adds an information.</p>
  
  <p>Does anyone has any idea where the problem could be?</p>
  
  <p>Thank you in advance!</p>