title: Getting HttpErrorResponse Error Status 400 while calling Web Api
body: <p>My Code is pretty simple and other calls with same design are working. Below is the <a href="https://i.stack.imgur.com/FLi3x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FLi3x.png" alt="Error"></a>  The http call is not hitting WEB API controller.</p>
  
  <pre><code>loginUser(login: ApiLoginDetails) {
      return this.http
        .post(`https://localhost:44314/api/users/login`, login)
        .pipe(catchError(error =&gt; this.errorHandler(error)));
   }
  </code></pre>
  
  <p>Here is the web api end point code: </p>
  
  <pre><code> [HttpPost]
      [Route("login")]
      public async Task&lt;IActionResult&gt; LoginUser(ApiLoginDetails login)
      {
          var isValidUser = await this.loginService.ValidateUserAsync(login.Username, login.Password);
  
          if (!isValidUser)
          {
              return this.BadRequest();
          }
  
          await this.loginService.SignInAsync(login.Username, false);
  
          return this.Ok();
      }
  </code></pre>