title: Angular2 404 Not Found for URL: http://localhost/WebApi2/api/hero
body: <p>I have tried the http Angular 2 and TypeScript example on <a href="https://angular.io/docs/ts/latest/tutorial/toh-pt6.html" rel="nofollow noreferrer">https://angular.io/docs/ts/latest/tutorial/toh-pt6.html</a> it works.
  <a href="https://embed.plnkr.co/?show=preview" rel="nofollow noreferrer">https://embed.plnkr.co/?show=preview</a></p>
  
  <p>Updated code to use external Web Api</p>
  
  <pre><code>private headers = new Headers({'Content-Type': 'application/json'});
  // private heroesUrl = 'api/heroes';  // URL to web api
  private heroesUrl = 'http://localhost/WebApi2/api/hero';  // URL to web api
  
  constructor(private http: Http) { }
  
  getHeroes(): Promise&lt;Hero[]&gt; {
     return this.http.get(this.heroesUrl)
                 .toPromise()
                 .then(response =&gt; response.json().data as Hero[])
                 .catch(this.handleError);
  }
  </code></pre>
  
  <p>Now I want to update it to use an external Web Api2 and get the error below.</p>
  
  <blockquote>
    <p>EXCEPTION: Uncaught (in promise): Response with status: 404 Not Found for URL: <a href="http://localhost/WebApi2/api/hero" rel="nofollow noreferrer">http://localhost/WebApi2/api/hero</a>"
    An error occurred Object { _body: Object, status: 404, ok: false, statusText: "Not Found", headers: Object, type: null, url: "<a href="http://localhost/WebApi2/api/hero" rel="nofollow noreferrer">http://localhost/WebApi2/api/hero</a>" }</p>
  </blockquote>
  
  <p>I have looked at this solution but it does not work for me.
  <a href="https://stackoverflow.com/questions/37794216/angular2-http-get-request-results-into-404">Angular2 http get request results into 404</a></p>
  
  <p>Error on import</p>
  
  <pre><code>import { Injectable }    from '@angular/core';
  import { Headers, Http } from '@angular/http';
  import { JSONP_PROVIDERS } from '@angular/http';
  </code></pre>
  
  <blockquote>
    <p>Http/Http/node_modules/@angular/http/index"' has no exported member 'JSONP_PROVIDERS'.</p>
  </blockquote>
  
  <p>Could anyone point me in the correct direction, example of calling Web Api2 from Angular2?</p>