title: Adding an accept header in Angular 5
body: <p>How do I add an accept header in Angular 5? </p>
  
  <p>I am using GitHub API to show Projects in a GitHub repository. The <a href="https://developer.github.com/v3/projects/" rel="nofollow noreferrer">GitHub API documentation</a> says that to use it, I must provide a custom media type in the Accept header.</p>
  
  <p>Here is my code. It currently returns the Unsupported Media Type Error.</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  import { GitIdInfo, GitRepo, GitProject} from './github-id';
  import { Observable } from 'rxjs/Observable';
  
  const githubAPI = 'https://api.github.com/';
  
  @Injectable()
  export class GitIdInfoService {
  
    constructor(private http: HttpClient) { }
  
    GetGitProj(login, Repo: String): Observable&lt;GitProject[]&gt;{
      const userProject = githubAPI + 'repos/';
      return(this.http.get&lt;GitProject[]&gt;(userProject + login + '/' + Repo + '/projects'));
    }
  }
  </code></pre>