title: TypeError: error.json is not a function
body: <p><strong>Edit: Read the part at the end of the question!</strong></p>
  
  <p>I get this error:<a href="https://i.stack.imgur.com/4n85B.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4n85B.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/v2nHO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/v2nHO.png" alt="enter image description here"></a></p>
  
  <p>My service code:</p>
  
  <pre><code>import { Http, Response, Headers } from "@angular/http";
  import { Injectable } from "@angular/core";
  import 'rxjs/add/operator/map';
  import 'rxjs/add/operator/catch';
  import { Observable } from "rxjs";
  
  import { Client } from "./client.model";
  
  @Injectable()
  export class ClientService {
      private clients: Client[] = [];
  
      constructor(private http: Http){}
  
      addClient(client: Client) {
          this.clients.push(client);
          const body = JSON.stringify(client);
          const headers = new Headers({'Content-Type': 'application/json'});
          return this.http.post('http://localhost:3000/client', body, {headers: headers})
              .map((response: Response) =&gt; response.json())
              .catch((error: Response) =&gt; Observable.throw(error.json()));
      }
  
      getClients() {
          return this.clients;
      }
  
      deleteClient(client: Client) {
  
      }
  }
  </code></pre>
  
  <p>And in my component I have this submit function:</p>
  
  <pre><code>onSubmit(form: NgForm) {
      let email = form.value.email;
      let password = form.value.password;
      let firstName = form.value.firstName;
      let lastName = form.value.lastName;
  
      const client = new Client(email, password, firstName, lastName);
      this.clientService.addClient(client)
          .subscribe(
              data =&gt; console.log(data),
              error =&gt; console.error(error)
          );
      form.resetForm();
  }
  </code></pre>
  
  <p>There are similar errors <a href="https://stackoverflow.com/q/34515173/2977288">here</a> and <a href="https://stackoverflow.com/q/39162056/2977288">here</a>. The answer is always to include the rxjs functions, but I do that, so I'm not quite sure, why I get this error.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>So the actual problem was not this function, but a missing "/" before my route in the main app.js file. After solving that, the issue was gone.</p>