Microsoft Graph 中的单引号转义
Single quote escaping in Microsoft Graph
我正在尝试通过显示名称查询用户,但在通过 C# SDK 和 Graph Explorer 发送请求时我无法转义单引号。
更新:示例中不清楚,我遇到问题的搜索词是I'
示例查询:
https://graph.microsoft.com/v1.0/users?$filter=startsWith(displayName,'I%27') 结果
Status Code: 400
{
"error": {
"code": "BadRequest",
"message": "There is an unterminated string literal at position 28 in 'startsWith(displayName,'I'')'.",
// snip
}
}
我尝试了各种转义,使用反斜杠、双引号、%2527
而不是引号,都没有用。用报价查询的正确方法是什么?
https://graph.microsoft.com/v1.0/users?$filter=startsWith(displayName,'I''')
SQUOTE-in-string = SQUOTE SQUOTE ; two consecutive single quotes
represent one within a string literal
我正在尝试通过显示名称查询用户,但在通过 C# SDK 和 Graph Explorer 发送请求时我无法转义单引号。
更新:示例中不清楚,我遇到问题的搜索词是I'
示例查询: https://graph.microsoft.com/v1.0/users?$filter=startsWith(displayName,'I%27') 结果
Status Code: 400
{
"error": {
"code": "BadRequest",
"message": "There is an unterminated string literal at position 28 in 'startsWith(displayName,'I'')'.",
// snip
}
}
我尝试了各种转义,使用反斜杠、双引号、%2527
而不是引号,都没有用。用报价查询的正确方法是什么?
https://graph.microsoft.com/v1.0/users?$filter=startsWith(displayName,'I''')
SQUOTE-in-string = SQUOTE SQUOTE ; two consecutive single quotes represent one within a string literal