angular 2 http post not working
问题 Here's my code: const dummydata = { param1: 72766, param2: 'ELS' } var foo = JSON.stringify(dummydata) let headers = new Headers(); headers.append('content-type', 'application/json'); this.http.post(url, foo, { headers: headers }).map(res => res.json()).subscribe( () => { alert('Success'); } ); For some reason there's no data going to the server as form-data in Request Payload and the type is getting converted to OPTIONS instead of POST On the other hand if I remove, headers , then the form