Managing Media Entities A media entity is an entity that represents an out-of-band stream, such as a photograph. A media entity MUST have a source URL that can be used to read the media stream, and MAY have a media edit URL that can be used to write to the media stream. Because a media entity has both a media stream and standard entity properties special handling is required. Creating a Media Entity A 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 header. Upon successful completion, the response MUST contain a that contains the edit URL of the created entity. Upon successful completion the service responds with either , or if the request included a with a value of . Editing a Media Entity Stream A successful PUT request to the media edit URL of a media entity changes the media stream of the entity. If the entity includes an ETag for the media stream, the client MUST include an header with the ETag value. The request body MUST contain the new media value for the entity whose media type MUST be specified in a header. If the request to edit a media stream returns a non-empty response body, the response body MUST contain the updated media entity. Deleting a Media Entity A successful DELETE request to the entity's edit URL deletes the media entity as described in Deleting a media entity also deletes the media associated with the entity. Managing Stream Properties An entity may have one or more stream properties. Stream properties are properties of type Edm.Stream. The values for stream properties do not appear in the entity payload. Instead, the values are read or written through URLs. Editing Stream Values A successful PUT request to the edit URL of a stream property changes the stream associated with that property. If the stream metadata includes an ETag value, the client SHOULD include an header with the ETag value. The request body MUST contain the new media value for the stream whose media type MUST be specified in a header. It may have a Content-Length of zero to set the stream data to empty. Stream properties MAY specify a list of acceptable types using an annotation with term Core.AcceptableMediaTypes, see . Managing Values and Properties Directly Values and properties can be explicitly addressed with URLs. This allows them to be individually modified. See for details on addressing.
Revision History Revision Date Editor Changes Made Working Draft 01 2012-08-22 Michael Pizzo Translated Contribution to OASIS format/template Committee Specification Draft 01 2013-04-26 Michael Pizzo, Ralf Handl, Martin Zurmuehl Added Delta support, Asynchronous processing, Upsert Aligned and expanded Prefer header preferences Simplified data Defined rules and semantics around distributed metadata Fleshed out descriptions and examples and addressed numerous editorial and technical issues processed through the TC Added Conformance section Committee Specification Draft 02 2013-07-01 Michael Ralf Handl, Martin Zurmuehl Cleaned up action and function overloads and binding, removed function parameter syntax Improved asynchronous processing and callback notifications Improved context URL (formerly: metadata URL) Improved handling of empty results Improved description of rules for processing PUT and POST requests, especially deep inserts Harmonized $count and $inlinecount Committee Specification 01 2013-07-30 Michael Pizzo, Ralf Handl, Martin Zurmuehl Non-Material Changes