gpt4 book ai didi

ios - 如何快速修复 HTTPBODY 的这些参数?

转载 作者:行者123 更新时间:2023-11-29 13:52:05 29 4
gpt4 key购买 nike

我有;

let parameters =
[
"generalSearchInput": search,
"requireAllWords": true,
"brandOwner": brand,
"includeDataTypes":
{
"Branded": true
}
] as [String : Any]

以上显然不起作用,我只是不明白如何嵌套。

我正在尝试模仿;

{
"generalSearchInput": "SHARP CHEDDAR CHEESE",
"requireAllWords": true,
"brandOwner": "usa",
"includeDataTypes":
{
"Branded": true
}
}

谢谢

最佳答案

尝试

let parameters: [String : Any] =
[
"generalSearchInput": search,
"requireAllWords": true,
"brandOwner": brand,
"includeDataTypes":
[
"Branded": true
]
]

In swift dictionary composing a json dictionary is expressed with [:] and array with [ ]

关于ios - 如何快速修复 HTTPBODY 的这些参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59166908/

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