I am trying to make call to sharepoint LIST REST APIs. I am logged in to sharepoint and when in browser i type like
https://myserver.sharepoint.com/sites/mylist/_api/lists/getbytitle('OEC_Docs')/items
It returns me data in the browser as expected. However using the code like below in my angular 4 app throws 403
getDocs(){
const httpOptions = {
headers: new HttpHeaders({
'Accept': 'application/json;odata=verbose',
'Content-Type': 'application/json'
})
};
return this.http.get(this.sharePointRestHost, httpOptions)
}
As the app is running on localhost
in the same browser so i am expecting it to work. Please advise how to fix it.