Hi, I want to access private domain(for example: https://172.17.13.105/API/) to requesting to server and fetch API response, but unable to retrieve data in release build.
Here is my httpservice.ts
file:
import { HttpClient, HttpHeaders } from '@angular/common/http';
async apiPostService(serverFile: any, postData: any) {
this.ionLoader.showLoading();
return new Promise(resolve => {
const headers = new HttpHeaders();
const options = { headers: headers, withCredintials: false };
this.baseurl = environment.apiUrl + serverFile;
this.http.post(this.baseurl, postData, options).subscribe(data => {
resolve(data);
this.ionLoader.hideLoader();
}, err => {
this.ionLoader.hideLoader();
this.errorAlert('Error', err, 'service1');
});
});
}
Ionic:
Ionic CLI : 6.19.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.3.3
@angular-devkit/build-angular : 0.1000.8
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : 11.0.0
Cordova Platforms : android 10.1.2
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 29 other plugins)
Utility:
cordova-res : not installed globally
native-run (update available: 1.7.2) : 1.5.0
System:
ios-deploy : 1.11.4
ios-sim : ios-sim/9.0.0 darwin-arm64 node-v16.13.2
NodeJS : v16.13.2 (/Users/oditek/.nvm/versions/node/v16.13.2/bin/node)
npm : 9.6.7
OS : macOS
Xcode : Xcode 14.3 Build version 14E222b
How to do it and the logic behind it. Kindly suggest the best answer to fetch data from server using private network.