Sharepoint Online: Difference between SPAppWebUrl & SPHostUrl

一笑奈何 提交于 2019-12-06 15:41:03

SPHostUrl is the url of the host url as the name already tells. That means it is the url of the sharepoint system.

SPAppWebUrl is the url of the app web. For example it could is the provider hosted apps address.

I think these are no other context urls.

SPHostUrl provide the URL for the host and SPAppWebUrl the app web.

SPAppWebUrl is always available to the remote web and can be used to create a client context for scenarios in which the SharePoint app is using the “internal” security principal.

SPHostUrl is the base URL of the host web. With this Url you can retrieve host web information like the following:

// retrieve host web information
string hostWebUrl = Request.QueryString[“SPHostUrl”];
Uri hostWebUri = new Uri(hostWebUrl);
string hostWebAuthority = hostWebUri.Authority;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!