From 6371a7edc62170ac3cf3e83ad06e45e1ba93079c Mon Sep 17 00:00:00 2001
From: Ralf Handl If an update specifies both a binding to a single-valued navigation property and a dependent property that is tied to a key property of the principal entity according to the same navigation property, then the dependent property is ignored, and the relationship is updated according to the value specified in the binding. If the entity being updated is open, then additional values for properties beyond those specified in the metadata or returned in a previous request MAY be sent in the request body. The service MUST treat these as dynamic properties. If the entity being updated is not open, then additional values for properties beyond those specified in the metadata or returned in a previous request SHOULD NOT be sent in the request body. The service MUST fail if it is unable to persist all updatable property values specified in the request. Upon successful completion the service responds with either Upon successful completion the service responds with either Update requests with an OData-Version header with a value of Payloads with an A Upon successful completion, the response MUST contain Upon successful completion the service responds with either Upon successful completion the service responds with either A successful If the entity includes an ETag value for the media stream, the client MUST include an 1
200 OK
and a representation of the updated entity, or 204 No Content
. The client may request that the response SHOULD include a body by specifying a Prefer
header with a value of return=representation
, or by specifying the system query options $select
or $expand
. If the service uses ETags for optimistic concurrency control, the entities in the response MUST include ETags.200 OK
and a representation of the updated entity, or 204 No Content
. The client may request that the response SHOULD include a body by specifying a return=representation
preference, or by specifying the system query options $select
or $expand
. If the service uses ETags for optimistic concurrency control, the entities in the response MUST include ETags.11.4.3.1 Update Related Entities When Updating an Entity
4.0
MUST NOT contain related entities as inline content. Such requests MAY contain binding information for navigation properties. For single-valued navigation properties this replaces the relationship. For collection-valued navigation properties this adds to the relationship.OData-Version
header with a value of 4.01
or greater MAY include nested entities and entity references that specify the full set of to be related entities, or a nested delta payload representing the related entities that have been added, removed, or changed. Such a request is referred to as a “deep update”. If the nested collection is represented identical to an expanded navigation property, then the set of nested entities and entity references specified in a successful update request represents the full set of entities to be related according to that relationship and MUST NOT include added links, deleted links, or deleted entities.11.4.7.1 Create a Media Entity
POST
request to a media entity’s entity set creates a new media entity. The request body MUST contain the media value (for example, the photograph) whose media type MUST be specified in a Content-Type
header. The request body is always interpreted as the media value, even if it has the media type of an OData format supported by the service. It is not possible to set the structural properties of the media entity when creating the media entity.Location
header that contains the edit URL of the created media entity.201 Created
, or 204 No Content
if the request included a Prefer
header with a value of return=minimal
.201 Created
, or 204 No Content
if the request included a return=minimal
preference.11.4.7.2 Update a Media Entity Stream
PUT
request to the media edit URL of a media entity changes the media stream of the entity.If-Match
header with the ETag value.A successful
PUT
request to the edit URL for a primitive property updates the value of the property. The message body MUST contain the new value, formatted as a single property according to the specified format.
A successful PUT
request to the edit URL for the raw value of a primitive property updates the property with the raw value specified in the payload. The payload MUST be formatted as an appropriate content type for the raw value of the property.
The same rules apply whether this is a regular property or a dynamic property.
-Upon successful completion the service responds with either 200 OK
or 204 No Content
. The client may request that the response SHOULD include a body by specifying a Prefer header with a value of return=representation
.
Upon successful completion the service responds with either 200 OK
or 204 No Content
. The client may request that the response SHOULD include a body by specifying a return=representation
preference.
Services MUST return an error if the property is not updatable.
A successful DELETE
request to the edit URL for a structural property, or to the edit URL of the raw value of a primitive property, sets the property to null. The request body is ignored and should be empty.
200 OK
or 204 No Content
. The client may request that the response SHOULD include a body by specifying a Prefer header with a value of return=representation
.
+Upon successful completion the service responds with either 200 OK
or 204 No Content
. The client may request that the response SHOULD include a body by specifying a return=representation
preference.
Services MUST return an error if the property is not updatable.
A successful PUT
request to the edit URL of a collection property updates that collection. The message body MUST contain the desired new value, formatted as a collection property according to the specified format.
POST
request to the edit URL of a collection property adds an item to the collection. The body of the request MUST be a single item to be added to the collection. If the collection is ordered, the item is added to the end of the collection, and if the collection supports positional insert $index
MAY be used to specify the insert position.
A successful DELETE
request to the edit URL of a collection property deletes all items in that collection.
Since collection members have no individual identity, PATCH
is not supported for collection properties.
Upon successful completion the service responds with either 200 OK
and a representation of the updated collection, or 204 No Content
. The client may request that the response SHOULD include a body by specifying a Prefer header with a value of return=representation
.
Upon successful completion the service responds with either 200 OK
and a representation of the updated collection, or 204 No Content
. The client may request that the response SHOULD include a body by specifying a return=representation
preference.
Services MUST return an error if the property is not updatable.
Collections annotated with the Core.Ordered
term (see OData-VocCore) have a stable order. Members of an ordered collection of primitive and complex types can be individually updated or deleted by invoking an update operation against the URL of the collection appended by a segment containing the zero-based ordinal of the item within the collection. A negative ordinal number indexes from the end of the collection, with -1 representing the last item in the collection.