I have seen this, and i have some questions.
I want to get the response from this uri:
http://www.instagram.com/justinbieber/media/
and i have implemented the following code for it:
import {Http,Headers} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import {Component,Injectable} from '@angular/core';
import {Gallery} from './gallery';
@Injectable()
export class InstagramService{
constructor( private _http:Http ){
}
getGallery(username: string) : Observable<Gallery> {
return this._http.get("http://www.instagram.com/justinbieber/media/" ).map(res => res.json());
}
}
Unfortunatlly, when i call this service it complains with :
XMLHttpRequest cannot load https://www.instagram.com/justinbieber/media/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
So there are some questions for me:
1- I can get the response from my browser or even postman, but not in my code. What makes this problem?
2-In case that, there is something wrong in my code, please provide your suggestion?
Hint: This uri does not support jsonp.get
too.