Http to htpps

private apilUrl=‘https://3.109.60.88/scanIngredients/

constructor( private http:HttpClient) { }

scanProduct(file:Blob):Observable{
const formData =new FormData();
formData.append(‘file’,file,‘ingredeints-list.jpg’);
return this.http.post(${this.apilUrl},formData)

}

this is my code when i am tring with http its working but when i am doing with https in browser gettting error also in androoid studio both http and https not working i am just scaning the image uploading is there any issue with my code let me know

If you use https you need proper certificates configured, can’t use self signed certificates.

If you use http you have to enable cleartext traffic because Android 9+ blocks all http connections by default. Here you can find multiple ways if enabling cleartext traffic Android 8: Cleartext HTTP traffic not permitted - Stack Overflow

For ignoring ssl errors (like when using self signed certificates) you can use this plugin GitHub - jcesarmobile/ssl-skip

But in both cases, remember to remove the plugin and the cleartext traffic before releasing the app.

I am using this “@ionic/angular”: “^8.0.0”,
@ionic/pwa-elements”: “^3.3.0”,
“ionicons”: “^7.0.0”,

can you please guide how can i add it in android studio clear text one

Android Studio Koala | 2024.1.1

It’s explained in the stack overflow link I shared