gpt4 book ai didi

odata - 如何在OData上扩展多个属性

转载 作者:行者123 更新时间:2023-12-03 15:18:18 25 4
gpt4 key购买 nike

考虑我有这个OData表达式:

http://services.odata.org/northwind/northwind.svc/Categories?
$expand=Products/Category


它将正确展开 Products.Category

现在,我也想扩展另一个属性。例如'Products.Supplier`。

我尝试复制 $expand用法:

http://services.odata.org/northwind/northwind.svc/Categories?
$expand=Products/Category
&$expand=Products/Supplier


但返回此错误失败:

Query parameter '$expand' is specified, but it should be specified exactly once.

最佳答案

根据OData ABNF,扩展语法应为:


expand ='$ expand'EQ expandItem *(COMMA expandItem)


等于:

$expand=expandItem1,expandItem2,expandItem3,...


因此,请尝试:

http://services.odata.org/northwind/northwind.svc/Categories?$expand=Products/Category,Products/Supplier



有关更多信息,请参见:

http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption

关于odata - 如何在OData上扩展多个属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23977434/

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