向量数据库VikingDB
/api/v1/content/download 接口用于以原始字节流下载 OpenViking 文件系统中的文件,适用于图片、PDF 和其他非文本内容。
- 成功响应为文件原始字节流,不使用标准 JSON 响应结构。
- 响应的
Content-Type为application/octet-stream,并通过Content-Disposition返回文件名。- 公共 SDK 和 CLI 当前没有独立的原始字节下载方法,本接口仅支持通过 HTTP API 调用。
完成 "数据库访问使用说明" 页面的 API Key 获取后,可调用本接口下载文件。
URI | /api/v1/content/download | 统一资源标识符 |
|---|---|---|
请求方法 | GET | 客户端请求类型 |
请求头 | X-API-Key: your-key | API Key 鉴权 |
参数 | 类型 | 必选 | 默认值 | 备注 |
|---|---|---|---|---|
uri | string | 是 | -- | 要下载的文件 URI |
成功时返回 HTTP 200 和文件原始字节,不使用标准 JSON 响应结构。
响应头 | 参数说明 |
|---|---|
Content-Type | 固定为 |
Content-Disposition | 以附件形式返回文件,并携带 UTF-8 编码的文件名 |
curl --get "https://xxx/api/v1/content/download" \ -H "X-API-Key: your-key" \ --data-urlencode "uri=viking://resources/images/logo.png" \ --output logo.png
执行成功返回:
HTTP/1.1 200 OK Content-Type: application/octet-stream Content-Disposition: attachment; filename*=UTF-8''logo.png <binary body>
下载成功后,文件内容会写入命令中 --output 指定的本地路径。