I am sending a form data using HTTP post where it will be like this
saveDataFile(mutlidata,id,value): Observable<Response> {
var _url = 'http://xxxx.xxx.xxx';
var saveDataURL = _url + '/' + id;
var _this = this;
let headers = new Headers();
headers.append('Content-Type', 'multipart/form-data');
let options = new RequestOptions({ headers: headers });
const frmData = new FormData();
frmData.append("file",JSON.stringify(mutlidata),'sample.json');
frmData.append("dataCheck",value);
return this.http.post(saveDataURL,frmData, options).pipe(
map((res: Response) => {
return res;
}),
catchError(this.handleError),);
}
here multidata will have
[["fakepath/test1.JPG","ea305e-be9d"],["fakepath/test2.JPG","489ce580-c50e-40e6-b1ab-71c7827f636c"]]
id will have 15asdas6asd6
value will have either true / false
here it is not sending the form data I guess and when I debug and checking the frmdata in return this.http.post(saveDataURL,frmData, options) here it is display form.entries, values, etc
in the sample.json file I'm appending the formdata
frmData.append("file",JSON.stringify(mutlidata),'sample.json');
and here file means I will have to send the data to the API using that key word