Below is the code I have written to send a request for uploading a file:
const uploadReq = new HttpRequest('POST', "https://localhost:44372/api/v1/Upload/UploadNewsPic"
, formData, { reportProgress: true });
this.http.request(uploadReq).subscribe(event => {
if (event.type === HttpEventType.UploadProgress)
this.progress = Math.round(100 * event.loaded / event.total);
else if (event.type === HttpEventType.Response)
this.message = event.body.toString();
})
I am also using an interceptor to automatically add 'application/json' as a header, but I do not want this header to be added for this specific request.
How can I achieve this?