url : appWebUrl +"/_api/SP.AppContextSite(@target)/web/lists?@target='"+hostUrl +"'",
This works well. I did not understand why cant cant we simply use this to make the call.
url : hostUrl +"/_api/web/lists,
Does it have to do anything with authenticating the app to the host site by passing the context ?
If we make a GET request
in a SharePoint-hosted app, we need a valid OAuth access token that is stored in the
Here is a blog for your reference :
TechNet Community Support
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?