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);