我正在使用HTML、AngularJS针对REST端点为SharePoint Server 2013 search创建一个提前类型的用户搜索。
我的具体问题是我的资源定义。
我使用的SharePoint搜索查询模式包含一个冒号(:):
.../_api/search/query?querytext=%27John+AND+Memberships:GRP-InformationSystems%27&sourceid=%27B09A7990-05EA-4AF9-81EF-EDFAB16C4E31%27以下是该服务的实现:
var searchService = servicesMod.factory('searchPeople', ['$resource',
function ($resource) {
return $resource('http://teamsint/_api/search/query?querytext=%27:searchText+AND+Memberships:GRP-InformationSystems%27&sourceid=%27B09A7990-05EA-4AF9-81EF-EDFAB16C4E31%27', { 'searchText': '@@searchText' }, {
query: { method: 'GET', isArray: false, withCredentials: true },
});
}]);..。angularjs错误地将其识别为参数,并将其从资源URL中删除。
请求按如下方式访问服务器:
api/search/query?querytext=%27John+AND+Memberships:-InformationSystems%27&sourceid=%27B09A7990-05EA-4AF9-81EF-EDFAB16C4E31%27
":GRP“是搜索查询的一部分,它被解析出URL。
是否有办法使冒号在本例中被忽略?
谢谢!
发布于 2016-06-16 14:03:02
这里的修正是在您不希望angularjs (1.5)认为它是参数时,用%3A替换查询字符串中的冒号(%3A)。
https://stackoverflow.com/questions/37727582
复制相似问题