createMedia

open override fun createMedia(entity: EntityValue, content: StreamBase, headers: HttpHeaders, options: RequestOptions)

Create a media entity with the specified content in the target system. If the entity has non-stream structural properties in addition to the key properties and media content, such as label in the examples below, then this function will send two requests to the server: a first request to upload (POST) the media stream, and a second request (PATCH/PUT) to update the non-stream properties. It is not currently supported to make these two calls atomic. Caution: Having too many threads simultaneously creating streams may result in out-of-memory conditions on memory-constrained devices.

Parameters

entity

Entity to be created.

content

Initial content. Must be a {@link com.sap.cloud.mobile.kotlin.odata.ByteStream} or {@link com.sap.cloud.mobile.kotlin.odata.CharStream}. Will be closed before this function returns.

headers

Request-specific headers.

options

Request-specific options.