@bhandaribhumin wrote:
return Observable.create(observer => { let access: any; console.log('url google api ',url); // let options = new RequestOptions({ headers: headers }); this.http.get(url).timeout(25000) .map(res => { console.log('GET RESPONSE =>', res); console.log('GET RESPONSE headers => ', res.headers); ] // If request fails, throw an Error that will be caught if (res.status < 200 || res.status >= 300) { throw new Error('This request has failed ' + res.status); } // If everything went fine, return the response else { console.log('GET IN SUCCESS RESPONSE ==> '); return res.json(); } }).subscribe(data => { access = data; console.log('<== GET IN Success subscribe ==> '); console.log("Custome Data observer Error :+", access); observer.next(access); observer.complete(); }, (err) => { console.log('<== GET IN Error subscribe ==> '); console.log("Custome Data observer Error :+", err); observer.next(false); observer.complete(); }); }).catch((error) => { console.log('In Observable Error => ', error); });
log is:
<== GET IN Error subscribe ==>
Custome Data observer Error :+ Response with status: 0 for URL: null
Posts: 1
Participants: 1