For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
预约演示登录免费开始
  • 概览
    • 什么是 API 定义?
    • 项目结构
      • 概览
      • 覆盖层(Overlays)
      • 覆盖(Overrides)
      • 身份验证
      • 服务器
      • 同步您的规范
        • HTTP JSON 端点
        • Webhooks
        • 多部分表单上传
        • 服务器发送事件
      • OpenAPI generators.yml 参考
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
预约演示登录免费开始
在本页
  • 文件数组
OpenAPI端点

多部分文件上传

使用 multipart/form-data 内容类型记录端点

||以 Markdown 格式查看|
此页面是否有帮助?
在仪表板中编辑
上一个

Webhooks

下一个

服务器发送事件和流式 API

多部分请求将一个或多个数据集组合到单个请求体中,通过边界分隔。 您通常使用这些请求进行文件上传,以及在单个请求中传输多种类型的数据 (例如,文件和 JSON 对象一起传输)。

openapi.yml
1paths:
2 /upload:
3 post:
4 summary: Upload a file
5 description: Upload a file using multipart/form-data encoding
6 operationId: uploadFile
7 tags:
8 - file
9 requestBody:
10 required: true
11 content:
12 multipart/form-data:
13 schema:
14 type: object
15 properties:
16 file:
17 type: string
18 format: binary
19 description: The file to upload
20 description:
21 type: string
22 description: A description of the file (optional)
23 required:
24 - file
25 responses:
26 "200":
27 description: Successful upload
28 content:
29 application/json:
30 schema:
31 type: object
32 properties:
33 message:
34 type: string
35 fileId:
36 type: string

任何使用 multipart/form-data 内容类型定义的请求体都将被视为多部分请求。在给定的多部分请求中,具有 format:binary 的字符串参数将表示任意文件。

文件数组

如果您的端点支持文件数组,那么您的请求体必须使用数组类型。

openapi.yml
1paths:
2 /upload:
3 post:
4 summary: Upload multiple files
5 operationId: uploadFiles
6 requestBody:
7 content:
8 multipart/form-data:
9 schema:
10 type: object
11 properties:
12 files:
13 type: array
14 items:
15 type: string
16 format: binary
17 description: An array of files to upload