gpt4 book ai didi

microsoft-graph-api - Microsoft Graph中的单引号转义

转载 作者:行者123 更新时间:2023-12-04 23:16:12 35 4
gpt4 key购买 nike

我正在尝试通过displayName查询用户,但是在同时使用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''') 

基于 http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/abnf/odata-abnf-construction-rules.txt:

SQUOTE-in-string = SQUOTE SQUOTE ; two consecutive single quotes represent one within a string literal

关于microsoft-graph-api - Microsoft Graph中的单引号转义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41491222/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com