title: HTTP 400 bad request Unexpected character encountered while parsing value Date
body: <p>I'm having trouble posting a date from my angular application to my ASP.net web api. Ive logged the data to the console and I get the following error:</p>
  <p><a href="https://i.stack.imgur.com/T1Tth.png" rel="nofollow noreferrer">API Response error</a></p>
  <p>In not entirely sure what is wrong with the date data I am trying to post. Is it in the wrong format? I'm using an Angular datetimepicker.</p>
  <p>Model with the 'DateFound' field which I think is causing the problem:</p>
  <pre><code>export class Nclog {
  
  id: number;
  DateFound?:  Date;
  LocationFound: string;
  NCTypeId: number;
  NCDescription: string;
  ActionTaken: string;
  CauseOfNc: string;
  InvestigatedBy: string;
  InvestigationStart?: Date;
  InvestigationFinish?: Date;
  CorrectiveAction: string;
  AddressRootCause: string;
  PreventsReoccurrance: string;
  Valid: boolean;
  ImplementedEffective: boolean;
  FollowUpComments: string;
  Effective: boolean;
  EffectivenessComments: string;
  Signed: string;
  Date?: Date;
  NCStatus: number;
  NCNumber: number;
  NotedBy: string;
  DateTest: Date;
  }
  </code></pre>
  <p>Service.ts</p>
  <pre><code>import { Injectable } from '@angular/core';
  import { Nclog } from './nclog.model';
  import { HttpClient } from '@angular/common/http';
  
  @Injectable({
    providedIn: 'root'
  })
  export class NclogService {
  
    nclogFormData: Nclog;
    list: Nclog[];
    readonly rootURL = &quot;https://localhost:44322/api&quot;
  
    constructor(private http: HttpClient) { }
  
    postLog(nclogFormData: Nclog) {
      console.log(JSON.stringify(nclogFormData));
      nclogFormData.id = 0;
      return this.http.post(this.rootURL+'/NCLog', nclogFormData);
    }
  
    refreshList(){
      this.http.get(this.rootURL+'/NCLog')
      .toPromise().then(res =&gt; this.list = res as Nclog[]);
    }
  </code></pre>
  <p>HTML</p>
  <pre><code>&lt;div class=&quot;form-group col-md-6&quot;&gt;
        &lt;label&gt;Date NC Found&lt;/label&gt;
        &lt;input class=&quot;form-control&quot; placeholder=&quot;yyyy-mm-dd&quot;
         name=&quot;DateTest&quot; #DateFound=&quot;ngModel&quot; [(ngModel)]=&quot;service.nclogFormData.DateFound&quot; ngbDatepicker #d=&quot;ngbDatepicker&quot;&gt;
        &lt;div class=&quot;input-group-append&quot;&gt;
        &lt;button class=&quot;btn btn-outline-secondary calendar&quot; (click)=&quot;d.toggle()&quot; type=&quot;button&quot;&gt;&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>