Is there a way to send FormData and a json object at the same time in http.request of angular 2+? I need the solution for angular2+, not to angularjs.
let data = {id: 1, name: 'test'};
let formData = new FormData();
formData.append('fileData', file); //file from inputfile
let headers = new Headers();
headers.append('Accept', 'application/json');
let options = new RequestOptions({ headers: headers });
options.method = 'POST';
options.body = data; //data is my object
//options.formData= formData; //formData is my FormData with file data to upload
this.http.request(url, options);