Uncaught Error: advanced-http: “data” option is configured to support only following data types: Object
anyone know how to fix this?
below i have mentioned my code. thanks.
don’t care about the API
async uploadImageData(formData: FormData) {
const loading = await this.loadingController.create({
message: 'Uploading image...',
});
await loading.present();
let nativeCall = this.nativehttp.post("http://localhost/api", formData, {});
from(nativeCall).pipe(
finalize(() => {
loading.dismiss();
})
).subscribe(res => {
if (res['success']) {
this.presentToast('File upload complete.');
} else {
this.presentToast('File upload failed.');
}
});
}