I am doing in this way:
fileUpload(data){
let headers = new HttpHeaders().set('file', data);
headers.append('Content-Type', 'application/file');
let file_upload = {
headers: headers,
};
console.log(data, "file upload")
return this.httpClient.post('api/data_loader/file/', file_upload);
}
Error:
Unsupported media type "application/json" in request.
Expected Result: I want to change this default media type to file format.
Note: I am using Angular6.