title: Access to XMLHttpRequest at 'http://localhost:8080 from origin 'http://localhost:4200' has been blocked by CORS policy
body: <p>This is the method from my component:</p>
  
  <pre><code>onDelete(s) {
      const conf = confirm('etes vous sur');
      if (conf) {
           console.log(s._links.self.href);
        this.catservice.Deleteprod(s._links.self.href).subscribe(data =&gt; {console.log(s._links.self.href);
        }, error1 =&gt; {
          console.log(error1);
        });
      }
    }
  </code></pre>
  
  <p>and this the method from my service:</p>
  
  <pre><code>  public Deleteprod(url) {
      return this.httpClient.delete(url);
    }
  </code></pre>
  
  <p>I want to delete this object with <code>s._links.self.href</code> so the <code>url</code> is not wrong but I have this problem when I try to make class <code>websecurityconfig</code> with her methods I tried with <code>@CrossOrigin(origins = "*")</code> but there is no solution please help me.</p>
  
  <p>This is my error:</p>
  
  <pre><code>Access to XMLHttpRequest at 'http://localhost:8080/offres/24' from origin 'http://localhost:4200' 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.
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/RU71E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RU71E.png" alt="this is my error i recupere the object but i cant delete it "></a></p>