Assuming this is Angular, your method declaration seems to be missing some type declarations which would allow Typescript to correctly identify the return type of the
post()
method:
PostUpload(selectedoptionsId, file) {
const formData: FormData = new FormData();
formData.append('file', file,file.name);
formData.append('selectedoptions',selectedoptionsId.toString());
return this.http.post('http://localhost:61265/api/DeliverySys/', formData);
}
Typescript is going to interpret the default return type as
any
, which means the call to
this.http.post()
is ambiguous. Could you try adding the correct return type to the method?
PostUpload(selectedoptionsId, file): Observable<Blob> {