2.2.7.3.5 UpdateValue Request
The purpose of the UpdateValue request is to enable the value of an EDMSimpleType property on an EntityType instance to be updated. AtomPub [RFC5023] does not define operations on subcomponents of an Entry Resource. As such, this request type is not based on an AtomPub-defined [RFC5023] request.
An UpdateValue request MUST use the HTTP PUT, PATCH, or MERGE method (as specified in PATCH/MERGE (section 2.2.4.1)). Additionally, the URI specified by the client in the HTTP request line MUST be a valid data service URI, as specified in URI Format: Resource Addressing Rules (section 2.2.3), that identifies the raw value of a property (of type EDMSimpleType) on an EntityType instance (or on one of the ComplexType properties of that EntityType instance).
The payload of the request MUST be formatted according to the rules defined in EDMSimpleType Property (section 2.2.6.4.1). A server receiving a request of this type MUST replace the value of the property addressed via the request URI with the value provided in the payload. The server MUST perform the same behavior whether the request uses the HTTP MERGE, PATCH, or PUT method.
If the UpdateValue request is successful, the response in OData 1.0 and OData 2.0 MUST have a 204 response code, as specified in [RFC2616], and have a 0 byte response body, unless a Prefer header (section 2.2.5.9) has been specified to request content. When an OData 1.0 or OData 2.0 request contains a Prefer header value that requests content or when OData 3.0 is used, the response MAY have a 200 response code, as specified in [RFC2616], and a response body that includes the updated entity that MUST be formatted the same as a response body to a RetrieveValue request (section 2.2.7.2.5).
If the UpdateValue request is not successful (for example, if an error occurs during request processing), the response MUST be formatted according to Error Response (section 2.2.8.1).
The syntax of an UpdateValue request is defined as follows:
-
updateValue-Req = updateValue-ReqLine updateValue-ReqHeaders CRLF updateValue-ReqBody updateValue-ReqLine = "PUT" | "MERGE"| "PATCH" SP entityTypeInstancePropertyUri "/$value" updateValue-QueryOps SP HTTP-Version CRLF updateValue-ReqHeaders = [DataServiceVersion] ; see section 2.2.5.3 [MaxDataServiceVersion] ; see section 2.2.5.7 [If-Match] ; see section 2.2.5.5 [Content-Type] ; see section 2.2.5.2 [Prefer] ; see section 2.2.5.9 *(HTTP-Header-Types) updateValue-ReqBody = <Property value formatted as per section 2.2.6.4.1> entityTypeInstancePropertyUri = ; see section 2.2.7.4.3 updateValue-QueryOps = ["?" customQueryOption *("&" customQueryOption)]
The syntax of a response to a successful UpdateValue request is defined as follows:
-
updateValue-Resp = Status-Line ; see [RFC2616] section 6.1.1 updateValue-RespHeaders CRLF [updateValue-RespBody] updateValue-RespHeaders = DataServiceVersion ; see section 2.2.5.3 [ETag] ; see section 2.2.5.4 [Preference-Applied] ; see section 2.2.5.10 *(HTTP-Header-Types) updateValue-RespBody = <Property value formatted as per section 2.2.6.4.1>