Skip to content

byos

Full name
@azure-tools/typespec-azure-core/byos

Operations that upload binary data (using content types like application/octet-stream or multipart/form-data) should use the Bring Your Own Storage (BYOS) pattern recommended for Azure Services.

See the Azure REST API Guidelines - BYOS for more details.

Uploading binary data with application/octet-stream:

op uploadFile(data: bytes, @header contentType: "application/octet-stream"): void;

Uploading with multipart/form-data:

op uploadFile(
@multipartBody data: {
data: HttpPart<bytes>;
},
@header contentType: "multipart/form-data",
): void;

Use the BYOS pattern where the client provides a storage location, instead of directly accepting binary data in the request body.

op download(): {
data: bytes;
@header contentType: "application/octet-stream";
};