188.8.131.52.7 UpdateMediaResource Request
An UpdateMediaResource request is used by a client to update an existing AtomPub media resource, as specified in [RFC5023] section 9.6. The AtomPub media resource maps to BLOB, which is described by an EntityType instance in the abstract data model used in this document, as described in Abstract Data Model (section 2.2.1). The base rules and semantics of this request type are defined by AtomPub, as specified in [RFC5023] section 9.6. This section adds constraints to those defined in AtomPub for this request type.
As in [RFC5023] section 9.6, requests of this type use the HTTP PUT method, and the URI specified by the client in the HTTP request line must represent an AtomPub media resource. Given that media resources are described by Media Links Entries, which map to EntityType instances in an Entity Data Model (EDM), the HTTP request line URI MUST be equal to any valid URI that identifies a media resource associated with an existing EntityType instance. The MERGE and PATCH methods defined in this document are not supported for requests of this type.
If the UpdateMediaResource 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 0 bytes in the response body, unless a Prefer header (section 184.108.40.206) 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 MUST be formatted the same as the response body to an InsertMediaResource request (section 220.127.116.11.3).
If the UpdateMediaResource request is not successful (for example, an error occurred during request processing), the response MUST be formatted according to Error Response (section 18.104.22.168).
The syntax of an UpdateMediaResource request is defined as follows:
updateMR-Req = updateMREntity-ReqLine updateEntity-ReqHeaders CRLF updateEntity-ReqBody updateMREntity-ReqLine = "PUT" SP entityTypeInstanceMRUri updateEntity-QueryOps SP HTTP-Version CRLF updateEntity-ReqHeaders = [Prefer] ; see section 22.214.171.124 ; see section 126.96.36.199.1 entityTypeInstanceMRUri = <Any Resource Path identifying the Media Resource described by an Entity Type instance represnting a Media Link Entry> ; see section 2.2.3 and section 188.8.131.52 – URI17 updateEntity-QueryOps = ; see section 184.108.40.206.1 updateMR-ReqBody = <Any valid HTTP request body> ; see [RFC5023] section 9.6
The syntax of a response to a successful UpdateMediaResource request is defined as follows:
updateMR-Resp = Status-Line ; see [RFC2616] section 6.1.1 updateMR-RespHeaders CRLF [updateMR-RespBody] updateMR-RespHeaders = DataServiceVersion ; see section 220.127.116.11 [ETag] ; see section 18.104.22.168 [Preference-Applied] ; see section 22.214.171.124 *(HTTP-Header-Types) updateMR-RespBody = <Media Entity in JSON format as per [ODataJSON4.0] section 10> / <Entity Type representing a Media Link Entry in Atom format as per section 126.96.36.199.2> / (begin-object quotation-mark "d" quotation-mark name-seperator entityTypeInVJson end-object) ; see section 188.8.131.52.3 ; the entityTypeInVJson representation MUST include all name ; value/pairs denoted in the mleMetadata rule