I’m trying to send a post request to an api. For some reason JSON.stringify is not working for my code and FormData either. Actually FormData is not appending the payload… After trying append data to it I get undefined.
const body = new FormData();
console.log(body); // gets undefined
body.append("url", url); // append payload
console.log(body); // gets undefined as well
var response = this.http.post(this.sumApiUrl, body, {headers: headers})
.map(res => <any>(res.json()).subscribe());
Does anyone know why FormData is appending the payload?