multipart/form-data
Multipart

Overview

multipart/form-data is the standard media type for HTML form submissions that include file uploads (RFC 7578). It splits one request body into multiple parts using a boundary string, with each part carrying a field name, filename, and its own Content-Type.

Details

The body divides parts using the `boundary` delimiter declared in the Content-Type header. Each part describes itself with `Content-Disposition: form-data; name="field"` (adding `filename="..."` for files), and file parts carry their own `Content-Type` (e.g. image/png). This structure lets text fields and binary files mix in a single request.

Why use this instead of x-www-form-urlencoded for files: urlencoded percent-encodes binary (bloating size) and cannot carry metadata like filenames or MIME. multipart transmits binary nearly verbatim and attaches per-part metadata, making it essential for file uploads. Conversely, a text-only form without files is more efficient as urlencoded than as higher-overhead multipart. The boundary string must be a unique value that never appears anywhere in the body.

Syntax

e.g. Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

Notes

Related types

Related headers