HttpClient does not return any response

Hi,

the HttpClient get method does not return any response on --prod --release on Android 9 or higher.

When I test my app in browser or in debug mode on device it works perfectly

    this.logger.log('Get Remote');
		return this.http.get(endpoint).subscribe(
			response => { this.logger.log(response); },
			err => { this.logger.log(err); },
		);

The above code only logs “Get remote”.

Thanks in advance!

If the first five letters of endpoint aren’t “https”, I would try seeing if the problem persists with an HTTPS endpoint. Incidentally, that return is very unusual, and it’s almost always a design flaw IMHO to be subscribing to an http request in the same function that initiates it. Instead, move the http.get to a service that returns an Observable<BusinessObject> and subscribe to that Observable somewhere else. The way it’s written now is too tightly coupled to the way the object is being retrieved, which makes the design brittle.