Postman
Multipart/Form-data Request
API Testing
Web Development
Data Transmission

How to send a multipart/form-data request in Postman (with file upload)

Codemia Knowledge Hub ·

To send multipart/form-data in Postman, set the method to POST, open the Body tab, select form-data, and add your fields. Mark each field as Text or File; File fields get a Select Files button for the upload. Then click Send.

How a multipart/form-data request is structured

Multipart/form-data is the MIME format for form submissions that include files, non-ASCII data or binary content. The data travels as a series of "parts" inside one message. Each part has a Content-Disposition header, plus a filename and Content-Type when the part is a file.

A typical request looks like this:

 
1POST /path HTTP/1.1
2Host: example.com
3Content-Type: multipart/form-data; boundary=------Boundary
4
5--------Boundary
6Content-Disposition: form-data; name="field1"
7
8value1
9--------Boundary
10Content-Disposition: form-data; name="file"; filename="example.txt"
11Content-Type: text/plain
12
13<FILE_CONTENTS>
14--------Boundary--

Postman builds this body and the boundary for you.

Steps in Postman

  1. Create a request:
    • Click 'New' or press Cmd + N / Ctrl + N.
    • Choose 'Request', fill in the request name and method (POST), and press 'Save'.
  2. Enter the request URL of the API endpoint.
  3. Set the method to 'POST' in the drop-down next to the URL field.
  4. Choose form-data:
    • Open the 'Body' tab under the URL field.
    • Select 'form-data' from the options (none, form-data, x-www-form-urlencoded, etc.).
  5. Enter the form fields:
    • For a text part, enter the key, select 'Text' in the right column, and enter the value.
    • For a file, enter the key, choose 'File' in the right column, and use the 'Select Files' button to pick a file.
  6. Send the request with the 'Send' button.

Example setup:

KeyValue TypeValue/File
usernameTextjohn.doe
profile_imageFile(choose a file)

Reading the response

Postman shows the response in the lower panel: status code, response time and body. The body format (JSON, XML and so on) depends on the API.

Debugging a failed upload

  • Check the headers: Content-Type should be 'multipart/form-data' with a boundary defined.
  • Check the API documentation: confirm the expected parameter names and file types.
  • Inspect the request body: open the Postman Console (View > Show Postman Console) to see the outgoing request and confirm the data is structured correctly.

Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design