Skip to main content

4.1. multipart/form-data 的 "Boundary" 参数

4.1. "Boundary" Parameter of multipart/form-data

🇬🇧 英文原文

As with other multipart types, a boundary is selected that does not occur in any of the data. Each part is expected to contain:

  • A Content-Disposition header field (described in Section 4.2) with a value of "form-data", and a name parameter.
  • Optional additional header fields.
  • A body.

Each part is separated by a boundary delimiter constructed using the value of the boundary parameter. The boundary delimiter MUST NOT appear inside any of the encapsulated parts, and the final boundary delimiter line has two hyphens after the boundary parameter value.

🇨🇳 中文翻译

与其他多部分类型一样,选择一个在任何数据中都不出现的边界。每个部分应该包含:

  • 一个值为 "form-data" 的 Content-Disposition 头字段(在第 4.2 节中描述),以及一个 name 参数。
  • 可选的附加头字段。
  • 一个主体。

每个部分由使用 boundary 参数值构造的边界分隔符分隔。边界分隔符禁止 (MUST NOT) 出现在任何封装部分的内部,最终边界分隔符行在 boundary 参数值后有两个连字符。