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 request to the entity's edit URL deletes the media entity as described in DELETE Deleting a media entity also deletes the media associated with the entity. Managing Stream Properties An entity may have one or more Stream properties are properties of type Edm.Stream. stream properties. 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 request to the edit URL of a stream property changes the stream associated with PUT 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.
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.
odata-v4.0-wd04-part1-protocol-2013-09-20.docx