2.2.7.3.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 has to 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 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 MUST be formatted the same as the response body to an InsertMediaResource request (section 2.2.7.1.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 2.2.8.1).

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 2.2.5.9
                            ; see section 2.2.7.3.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 2.2.3.5 – URI17
  
 updateEntity-QueryOps    = ; see section 2.2.7.3.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 2.2.5.3   
                            [ETag]                ; see section 2.2.5.4   
                            [Preference-Applied]      ; see section 2.2.5.10   
                            *(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 2.2.6.2.2>
                            / (begin-object
                               quotation-mark "d" quotation-mark
                               name-seperator
                               entityTypeInVJson  
                               end-object)
                              ; see section 2.2.6.3.3
                              ; the entityTypeInVJson representation MUST include all name 
                              ; value/pairs denoted in the mleMetadata rule
Show: