路径上带有破折号或连字符的Sitecore项目Web Api

路径上带有破折号或连字符的Sitecore项目Web Api,sitecore,Sitecore,有人知道在使用sitecore项目web api时如何转义连字符/破折号吗 路径:sitecore/内容/站点/主页/测试页/* 这是我的要求: host/-/item/v1/?sc_database=web&query=%2fsitecore%2fcontent%2fSite%2fHome%2fTest-page%2f* 以下是回应: {"statusCode":400,"error":{"message":"Bad Sitecore query (/sitecore/content

有人知道在使用sitecore项目web api时如何转义连字符/破折号吗

路径:sitecore/内容/站点/主页/测试页/*

这是我的要求:

host/-/item/v1/?sc_database=web&query=%2fsitecore%2fcontent%2fSite%2fHome%2fTest-page%2f*
以下是回应:

{"statusCode":400,"error":{"message":"Bad Sitecore query (/sitecore/content/Site/Home/Test-page/*)."}}

谢谢

您需要用空格或带有#字符的连字符包装任何内容。e、 g:

Path: sitecore/content/Site/Home/#Test-page#/*
多亏了下面的评论,散列标签将需要编码。这意味着您的url将如下所示:

Path: host/-/item/v1/?query=/sitecore/content/Site/Home/%23Test-page%23/*

退房

谢谢,它很有效。唯一的一件事是,我用它的编码代码%23 sitecore/content/Site/Home/%23测试页%23/*替换了#,请注意,在使用查询路径执行Get Item调用时,这也适用于sitecore Powershell扩展,如下所示:
Get Item-path master:-query”/sitecore/content/Home/#一些带有连字符的路径#/*[@@templatename='Folder']