title: Sending apikey in header, angular4
body: <p>I have an API REST that requires the apikey in the headers to validate, I am doing the query with angular 4, but the apikey is not sent in the headers.</p>
  
  <p>If I make the query with PostMan it works without problem. I'm stuck at this point, I appreciate your help friends.</p>
  
  <p>I need to send the "apikey" in the headers of the request something like that.</p>
  
  <p><a href="https://i.stack.imgur.com/VucjT.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>This is my code: </p>
  
  <pre><code>import { Component } from '@angular/core'
  import { OnInit } from '@angular/core';
  import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http'
  import 'rxjs/add/operator/map'
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent {
    private apiURL = 'http://192.168.1.53/joinn-api/v1'
    data: any = {}
  
    constructor(private http: HttpClient){
      this.getData()
      this.getEvents()
  
    }
  
    getData(){
      let headers = new HttpHeaders()
      headers = headers.set('apikey','!eqBwMfoWmEOWRoxxxxxxxK')
      return this.http.get(this.apiURL + '/event', {headers: headers})
        .map((res: Response) =&gt; res.json())
    }
  
    getEvents(){
      this.getData().subscribe(data =&gt; {
        console.log(data)
      })
  
    }
  </code></pre>