你的位置: 码友网首页 / 资讯源列表 / Optimistic Concurrency in an HTTP API with ETags & Hypermedia

关于[Optimistic Concurrency in an HTTP API with ETags & Hypermedia]的摘要:

How do you implement optimistic concurrency in an HTTP API? There are a couple of different ways, regardless of what datastore you’re using in the backend. You can leverage the ETag header in the HTTP Response to return a “version” of the resource that was accessed. When a client then needs to perform some operation on the resource, they send an If-Match header apart of the request with the value being the result of ETag from the initial GET request. Another option is to leverage hypermedia by returning URIs for actions relevant to a resource that include the version apart of the URI. This enables concurrency to be completely transparent and does not require any knowledge from the client.

原文地址: https://codeopinion.com/optimistic-concurrency-in-an-http-api-with-etags-hypermedia/

收录时间: 2021-12-16 浏览量: 887 分类: .NET Core

| 1 收藏 | 0