title: Post method on Angular 5. No error but it doesn't work
body: <p>When i am using post mehtod there is no error , but post method doesn't work <code>this.http.post</code>.(It worked yesterday, but today doesn't work. No idea) There is my service:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
  import {Observable} from 'rxjs/Observable';
  import {GetData} from './data';
  import {RequestMethod, RequestOptions} from '@angular/http';
  import {Router} from '@angular/router';
  
  @Injectable()
  export class ApiService {
    private apiUrl = 'http://localhost:4567/index';
    constructor(private http: HttpClient, private router: Router) { }
    getPosts(): Observable&lt;GetData[]&gt; {
      return this.http.get&lt;GetData[]&gt;(this.apiUrl);
    }
    createPost(post) {
    const url = 'http://localhost:4567/post';
      const httpParams = new HttpParams()
        .append('name', post.name)
        .append('subject', post.subject)
        .append('mark', post.mark);
      console.log(post.name);
      console.log(post.subject);
      console.log(post.mark);
      this.http.post(url, httpParams);
    }
  }
  </code></pre>
  
  <p>Here my component:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import {NgForm} from '@angular/forms';
  import {HttpClient, HttpHeaders} from '@angular/common/http';
  import {ApiService} from '../api.service';
  import {ViewEncapsulation} from '@angular/compiler/src/core';
  import {Observable} from 'rxjs/Observable';
  import {GetData} from '../data';
  
  @Component({
    selector: 'app-add-post',
    templateUrl: './add-post.component.html',
    styleUrls: ['./add-post.component.css']
  })
  export class AddPostComponent implements OnInit {
    constructor(private api: ApiService, private http: HttpClient) { }
    model = {
      name: '',
      subject: '',
      mark: ''
    };
    ngOnInit() {
    }
    onSubmit() {
      this.api.createPost(this.model);
    }
  }
  </code></pre>
  
  <p>component HTML</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;title&gt;Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form (ngSubmit)="onSubmit()" #form [ngFormOptions]="{ updateOn: submit}"&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="name"&gt;Name&lt;/label&gt;
      &lt;input [(ngModel)]="model.name" name="name" #name="ngModel" minlength="4" maxlength="10" required type="text" id="name" class="form-control"&gt;
      &lt;div class="alert alert-danger" [hidden]="name.valid || name.pristine"&gt;
        Area cannot be empty!!!
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="subject"&gt;Subject&lt;/label&gt;
      &lt;input [(ngModel)]="model.subject" name="subject" #subject="ngModel" minlength="4" maxlength="10" required type="text" id="subject" class="form-control"&gt;
      &lt;div class="alert alert-danger" [hidden]="subject.valid || subject.pristine"&gt;
        Area cannot be empty!!!
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="mark"&gt;Mark&lt;/label&gt;
      &lt;input [(ngModel)]="model.mark" name="mark" #mark="ngModel" minlength="4" maxlength="10" required type="number" id="mark" class="form-control"&gt;
      &lt;div class="alert alert-danger" [hidden]="mark.valid || mark.pristine"&gt;
        Area cannot be empty!!!
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;button class="btn btn-success" type="submit"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  &lt;div *ngIf="model.name &amp;&amp; model.subject &amp;&amp; model.mark"&gt;
    &lt;h3&gt;Hello {{model.name}} from {{model.subject}} your mark is {{model.mark}}&lt;/h3&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Module:</p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  
  import {AppRoutingModule, routinComponents} from './app-routing.module';
  
  import { AppComponent } from './app.component';
  import { ListComponent } from './list/list.component';
  import {ApiService} from './api.service';
  import {HttpClientModule} from '@angular/common/http';
  import { DescriptionComponent } from './description/description.component';
  import { AddPostComponent } from './add-post/add-post.component';
  import {FormsModule, ReactiveFormsModule} from '@angular/forms';
  
  
  @NgModule({
    declarations: [
      AppComponent,
      routinComponents,
      DescriptionComponent,
      AddPostComponent
    ],
    imports: [
      BrowserModule,
      FormsModule,
      ReactiveFormsModule,
      AppRoutingModule,
      HttpClientModule
    ],
    providers: [ApiService],
    bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1BWbI.png" rel="nofollow noreferrer">No post activity</a></p>