Seven price
asked on
Access-Control-Allow-Origin
XMLHttpRequest cannot load http://localhost:60712/api/Default. Request header field Access-Control-Allow-Origi n is not allowed by Access-Control-Allow-Heade rs in preflight response.
running ng serve http://localhost:4200/
Not sure what to do. I just want to test for local development.
I did the npm install ember-cli-cors
I added Cors to mvc project.
my headers in my angularCli project looks like
running ng serve http://localhost:4200/
Not sure what to do. I just want to test for local development.
I did the npm install ember-cli-cors
I added Cors to mvc project.
my headers in my angularCli project looks like
constructor(private _http: Http) { }
getUserAdminID(): Observable<any[]> {
let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': 'false','Access-Control-Allow-Methods': 'GET,HEAD,OPTIONS,POST,PUT',
'Access-Control-Allow-Headers': 'Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Content-Type' });
let options = new RequestOptions({ headers: headers });
return this._http.get(this._data, options)
.map((response: Response) => <any[]>response.json())
.catch((error: any) => Observable.throw(error.json().error ))//|| this.showError()
.do(data => console.log('List: ' + JSON.stringify(data)));
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER