Table of Contents

媒体接口

预声明变量

readonly KookSocketClient _socketClient = null;
readonly KookRestClient _restClient = null;

上传文件/图片

POST /api/v3/asset/create

Stream stream = null; // 文件流
string path = null; // 文件路径
string fileName = null; // 文件名

// API 请求
string assertUri = await _socketClient.Rest.CreateAssetAsync(stream, fileName);
string assertUri = await _socketClient.Rest.CreateAssetAsync(path, fileName);
string assertUri = await _restClient.CreateAssetAsync(stream, fileName);
string assertUri = await _restClient.CreateAssetAsync(path, fileName);