如何从 odata 调用中删除 Dynamics 365 财务和运营元数据?



我试图从OData中获取数据。链接如下。

https://*********.cloudax.dynamics.com/data/PurchaseOrderHeadersV2?$select=PurchaseOrderNumber,RequestedDeliveryDate,DeliveryAddressDescription&$filter=OrderVendorAccountNumber%20eq%20%27100001%27

我只在select子句中添加了3个字段。但是@odata.etag";字段已添加到响应中。答复如下。

{
"@odata.context":"https://****.cloudax.dynamics.com/data/$metadata#PurchaseOrderHeadersV2(PurchaseOrderNumber,RequestedDeliveryDate,DeliveryAddressDescription)","value":[
{
"@odata.etag":"W/"JzE5MDYyOTE2NzcsNTYzNzMwMzU3NjswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn"","PurchaseOrderNumber":"PO00003871","RequestedDeliveryDate":"2020-10-07T12:00:00Z","DeliveryAddressDescription":"******"
},{
"@odata.etag":"W/"JzE5NjkzNDMzOTUsNTYzNzMwMzU3NzswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn"","PurchaseOrderNumber":"PO00003872","RequestedDeliveryDate":"2020-09-16T12:00:00Z","DeliveryAddressDescription":"*******"
},{
"@odata.etag":"W/"JzIwNzgyNTg4OSw1NjM3MzAzNTc4OzAsMDsxLDU2MzcxNjMzMjY7MCwwOzAsMCc="","PurchaseOrderNumber":"PO00003873","RequestedDeliveryDate":"2020-10-08T12:00:00Z","DeliveryAddressDescription":"*****"
},{
"@odata.etag":"W/"JzE3MjYzMjQ0NzUsNTYzNzMwMzU3OTswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn"","PurchaseOrderNumber":"PO00003874","RequestedDeliveryDate":"2020-10-08T12:00:00Z","DeliveryAddressDescription":"**********"
},{
"@odata.etag":"W/"JzEsNTYzNzMwNDMyNjswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn"","PurchaseOrderNumber":"PO00003881","RequestedDeliveryDate":"2020-10-09T12:00:00Z","DeliveryAddressDescription":"*********"
}
]
} 

如何从响应中删除此元数据信息?

您可以尝试这些标头,这将从响应中消除元数据。

Content-Type: application/json; odata.metadata=minimal

事实上,你可以提到odata.metadata=none进行进一步的

apiurl?$format=application/json;odata.metadata=none

最新更新