title: Why is my header not responding in angular 7?
body: <p>MY <code>http</code>, <code>header</code>, <code>RequestOption</code> are not working properly in the API. I'm using Angular 7.1. I have tried every formula but nothing is happening.</p>
  
  <p><strong>I have this error:</strong></p>
  
  <blockquote>
    <p>token is not passing in header</p>
  </blockquote>
  
  <p><strong>I am using this code:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>import { Http,RequestOptions,Headers } from '@angular/http';
  import { keyframes } from '@angular/animations';
  
  @Injectable({
      providedIn: 'root'
  })
  export class UrlrequestService {
      public headers = new Headers({ 'Content-Type': 'application/json'});
      API:any = "http://api-url";
      constructor(public http: Http) { }
  
      get(url) {  
          this.headers.set('Authorization','Token  '+localStorage.getItem('token'))
          let options = { headers: this.headers };
          console.log(options)
          return this.http.get(this.API+url,options);
      }
  </code></pre>