I'm developing an rest api on java 6 because on my work are using Tomcat 6. I have de api point working on Postman but when I try to use it on my Ionic app it returns a wrong type(html instead of json).
Note that any header is supplied
On my Ionic App
Here I'm using the next code:
getPosData():Observable<any>{
let url = this.isProd ? this.urlBaseProd : this.urlBase;
url += "pos/getposall";
return this.httpClient.get(url);
}
This is my controller
and a generic response class.
My ionic info
✔ Gathering environment info - done!
Ionic:
ionic (Ionic CLI) : 4.2.1 (/home/usuario/.npm-global/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.1.2 ([email protected]) Cordova Platforms : android 7.1.2 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 8 other plugins)
System:
Android SDK Tools : 26.1.1 (/home/usuario/Android/Sdk) NodeJS : v8.12.0 (/usr/bin/node) npm : 6.4.1 OS : Linux 4.15