Hello,
Am facing some issues on http request on real device
Calling function:
public makeGetRequest() {
return new Promise(resolve => {
//http://abc.xyz.com:8764/myapp/getItems
this.http.get('http://httpbin.org/get').subscribe(data => {
console.log("\n\n\nGet Method Success: " + JSON.stringify(data) + "\n\n\n\n");
resolve(data);
}, err => {
console.log("\n\n\nGet Method Error: " + JSON.stringify(err) + "\n\n\n\n\n");
});
});
}
When accessing http://httpbin.org/get, i get below response:
{
"firstName": "John",
"lastName": "Smith",
"gender": "man",
"age": 32,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021"
},
"phoneNumbers": [
{ "type": "home", "number": "212 555-1234" },
{ "type": "fax", "number": "646 555-4567" }
]
}
When accessing http://abc.xyz.com:8764/myapp/getItems, i get below error:
{
"headers": {
"normalizedNames": {
},
"lazyUpdate": null
},
"status": 404,
"statusText": "Not Found",
"url": "http://localhost:8080/http://abc.xyz.com:8764/myapp/getItems”,”ok": false,
"name": "HttpErrorResponse",
"message": "Http failure response for http://localhost:8080/http://vs2.paramatrix.com:8764/pace/heartbeat: 404 Not Found",
"error": null
}
Ionic info:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : Update notifier was not able to access the config file. You may grant permissions to the file: 'sudo chmod 744 ~/.config/configstore/update-notifier-cordova.json' 7.1.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : Update notifier was not able to access the config file. You may grant permissions to the file: 'sudo chmod 744 ~/.config/configstore/update-notifier-cordova.json' android 6.3.0 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
Node : v8.9.1
npm : 5.5.1
OS : macOS Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : /Users/Administratoe/Library/Android/sdk
Misc:
backend : pro
ionic.config.json
{
"name": "eppm",
"app_id": "",
"type": "ionic-angular",
"integrations": {
"cordova": {}
},
"proxies": [
{
"path": "/pace",
"proxyUrl": "http://abc.xyz.com:8764/myapp"
}
]
}
Please help me to figure it out.