title: post method not working without any error
body: <p>I am creating a simple crud operation using angular and asp.net core webapi.When i try with value to post value it is not working.</p>
  
  <p>post component:</p>
  
  <pre><code>&lt;div class="col-md-4"&gt;
  &lt;form (ngSubmit)="validateuser()" #homeForm="ngForm"&gt;
  &lt;div class="form-group"&gt;
    &lt;label for="address"&gt;User Name&lt;/label&gt;
    &lt;input type="text "  min="0" class="form-control" [(ngModel)]="datas.username" name="username" required&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
    &lt;label for="address"&gt;Password&lt;/label&gt;
    &lt;input type="text "  min="0" class="form-control" [(ngModel)]="datas.password" name="password" required&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;div class="form-group"&gt;
    &lt;button type="submit"    class="btn btn-success" [disabled]="!homeForm.form.valid"&gt;login&lt;/button&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>service :</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  import { ViewEncapsulation } from '@angular/core';
  import { UrlResolver } from '@angular/compiler';
  import { Router } from '@angular/router';
  
  @Component({
    selector: 'app-login',
    templateUrl: './login.component.html',
    styleUrls: ['./login.component.css'],
    encapsulation: ViewEncapsulation.None
  })
  export class LoginComponent implements OnInit {
    datas= {};
  
    constructor(private http: HttpClient, private router: Router) { }
  
    ngOnInit() {
    }
    validateuser() {
      this.http.post('http://localhost:7254/api/user/token',this.datas)
        .subscribe(res =&gt; {
          console.log(res);
          this.router.navigate(['/homes']);
  
  
          }, (err) =&gt; {
            this.router.navigate(['/login']);
          }
  
        );
        }
      }
  
  </code></pre>
  
  <p>API Conroller:</p>
  
  <pre><code>namespace WebAPI.Controllers
  {
      [Produces("application/json")]
      [Route("api/User")]
      public class UserController : Controller
      {
          private readonly ModelItemContext _context;
  
          public UserController(ModelItemContext context)
          {
              _context = context;
          }
  
          [HttpPost("{token}")]
          public ActionResult CreateToken([FromBody] User item_2)
          {
              var item_1 = _context.User.FirstOrDefault(t =&gt; t.UserName == item_2.UserName &amp;&amp; t.Password == item_2.Password);
              if (item_1 == null)
              {
                  return NotFound();
              }
              _context.User.Update(item_1);
              _context.SaveChanges();
              return new NoContentResult();
          }
  
  
      }
  }
  </code></pre>
  
  <p>When i try with debug point . the value not hit to angular service file. what is wrong here.please give me idea.The same method working for create user . but not working when i check with password and user name.</p>