如何从 odata 调用中删除 Dynamics 365 财务和运营元数据?
How to remove Dynamics 365 finance & operation metadata from odata call?
我尝试从 OData 获取数据。
link如下。
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":"*********"
}
]
}
如何从响应中删除此元数据信息?
您可以尝试这些 headers,这将从响应中删除元数据。
Content-Type: application/json; odata.metadata=minimal
其实你可以再提一下odata.metadata=none
apiurl?$format=application/json;odata.metadata=none
我尝试从 OData 获取数据。 link如下。
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":"*********"
}
]
}
如何从响应中删除此元数据信息?
您可以尝试这些 headers,这将从响应中删除元数据。
Content-Type: application/json; odata.metadata=minimal
其实你可以再提一下odata.metadata=none
apiurl?$format=application/json;odata.metadata=none