gpt4 book ai didi

testing - LB 和 RB 边界中的 web_reg_save_param() 是否有任何正则表达式?

转载 作者:行者123 更新时间:2023-11-28 21:28:18 25 4
gpt4 key购买 nike

具有以下功能:

web_reg_save_param("questionId", "LB=secretKnowledges\":\\[\\{", "RB=\"", LAST);

我 try catch 来自服务器响应的“questionId”参数的值作为(json 文件),看起来是这样的:

"salutation":{"firstNaAction me":"Sebastian","lastName":"Martens"},"userAccount":{"mail":"gcdmtest_bp_pr_acc_po_20073@trash-mail.com","notificationLevel":"NEW_DEVICE","authenticationLevel":"ONE_FACTOR","gcid":"bb2e64a9-1b39-4692-9c52-4845eb15c4f7","secretKnowledges":[{"questionId":11301},{"questionId":11302}],"secretKnowledgeActivated":true,"status":"ACTIVATED"}}

而不是我得到以下错误:

Action.c(23): Error -26377: No match found for the requested parameter "questionId". Either the specified boundaries were not found in the response or the matched text is longer than current max html parameter size of 8000 bytes. The total length of the response is 1506 bytes. You can use web_set_max_html_param_len to increase the max parameter size.    [MsgId: MERR-26377]Action.c(23): Notify: Saving Parameter "questionId = ".

我做错了什么?

最佳答案

不知道我是否理解你的意思。如果您需要响应中所有 questionId 参数的值,请尝试以下操作:

web_reg_save_param("questionId", "LB={\"questionId\":", "RB=}", "Ord=All", LAST);

这将生成参数数组 questionId_1questionId_2 等。参数的数量也将保存到 questionId_count 参数中。但是,如果您只需要该参数的第一次出现,只需跳过 Ord=All 参数即可。

还有一个用于 JSON 响应的特殊提取 API:web_reg_save_param_json .这是您的案例的示例:

web_reg_save_param_json("ParamName=questionId", "QueryString=$..questionId",
"SelectAll=Yes", LAST);

此外,如果您需要基于 RegEx 的参数提取,您可以尝试 web_reg_save_param_regexp .

关于testing - LB 和 RB 边界中的 web_reg_save_param() 是否有任何正则表达式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33041233/

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