title: RequestOptions migration Angular 5
body: <p>I was using a custom request options in Angular 4 where I was doing the following:</p>
  
  <p>default-request-options.service.ts</p>
  
  <pre><code>@Injectable()
  export class DefaultRequestOptions extends BaseRequestOptions {
    headers = new Headers({
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    });
  
    merge(options?: RequestOptionsArgs): RequestOptions {
      var newOptions = super.merge(options);
      const token: string = localStorage.getItem('token');
      if (token) {
        newOptions.headers.set('token', token);
      }
      return newOptions;
    }
  }
  </code></pre>
  
  <p>App.Module.ts</p>
  
  <pre><code>providers: [ // expose our Services and Providers into Angular's dependency injection
      { provide: RequestOptions, useClass: DefaultRequestOptions }
    ]
  </code></pre>
  
  <p>But after the migration notice that the RequestOption is not available in the new folder http/common/http</p>
  
  <p>I'm would like to know if I still can use similar thing in Angular 5 or there is no point using it with the new HTTPClient? The main advantage for me was to set in one place only, not having to append it to all my requests.</p>
  
  <p>I got the code initially in the angular docs: <a href="https://github.com/angular/angular.io/blob/master/public/docs/_examples/server-communication/ts/src/app/default-request-options.service.ts" rel="noreferrer">https://github.com/angular/angular.io/blob/master/public/docs/_examples/server-communication/ts/src/app/default-request-options.service.ts</a></p>