We are new to Azure API management. We are caching Dataverse master entities web api calls and looking to see how we can add ETag as part of response headers in Azure API Management(Backend call doesnt have this header as well). How do we retrieve this at Operations level? and is there any reference documentation available. Sorry could not find any. Thanks in Advance
We are caching Dataverse master entities web api calls and looking to see how we can add ETag as part of response headers in Azure API Management(Backend call doesnt have this header as well). How do we retrieve this at Operations level?
HEAD https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}?api-version=2021-04-01-preview
public class OrdersController : ApiController
{
...
public IHttpActionResult FindOrderByID(int id)
{
// Find the matching order
Order order = ...;
...
var hashedOrder = order.GetHashCode();
string hashedOrderEtag = $"\"{hashedOrder}\"";
var eTag = new EntityTagHeaderValue(hashedOrderEtag);
// Return a response message containing the order and the cache control header
OkResultWithCaching<Order> response = new OkResultWithCaching<Order>(order, this)
{
...,
ETag = eTag
};
return response;
}
...
}
You can refer to Backend - Get Entity Tag , Does Azure Search Provides Etags for managing concurrency for Add, Update or Delete Documents? and What is ETag and why people use it
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.