title: 400 Bad request Error when http post from angular into .NET Core Web API
body: <p>I am trying to post some values to my .NET core web api function from Angular. Its triggering an 400 bad request error. At the same time Get is working fine.</p>
  <p>Here are my Web APIs</p>
  <pre><code>    [HttpGet]
      public List&lt;GenExternalActualDeletionLog&gt; Get()
      {
          return _svc.DeletionLogs();
      }
  
  
      // POST api/&lt;DeleteExternalActuals&gt;
      [HttpPost]
      public ActionResult&lt;List&lt;GenExternalActualDeletionLog&gt;&gt; Post(String pCode,string[] expenseKeys)
      {
          return Ok(_svc.DeleteExternalActual(pCode, expenseKeys, _caller.Identity.Name).OrderByDescending(x =&gt; x.DeletedOn));
      }
  </code></pre>
  <p>And here is my angular service calling the web apis</p>
  <pre><code> DeleteData(configuration: ExternalActualsDeleteData): Observable&lt;any&gt; {
  
  this.baseUrl = this.conf.getSettings(&quot;apiUrl&quot;);
  
  let hd = new HttpHeaders();
  hd.append('Content-Type', 'application/json');
  
  const headers = new HttpHeaders().set(&quot;Content-Type&quot;, 'application/json');
  //alert(this.baseUrl +'/api/closure/ClosureOverride');
  console.info(configuration);
  return this.http.post(this.baseUrl + '/api/DeleteExternalActuals', {pCode:configuration.pCode,expenseKeys:configuration.expenseKeys});
  
  }
  
  GetAllDeleteLogs(): Observable&lt;ExternalActualsDeleteLog[]&gt; {
  
  this.baseUrl = this.conf.getSettings(&quot;apiUrl&quot;);
  return this.http.get&lt;ExternalActualsDeleteLog[]&gt;(this.baseUrl + &quot;/api/DeleteExternalActuals&quot;).pipe(
    catchError((err) =&gt; {
      console.log('error caught in  service')
      console.error(err);
  
      //Handle the error here
  
      return throwError(err);    //Rethrow it back to component
    })
  );
  </code></pre>
  <p>}</p>
  <p>Here only post shows error. Get working fine. Is it because of the way I am sending parameter? or anything else? The call is not even reaching the server side api. Thats why I thought about the parameter</p>