3.1 KiB
3.1 KiB
Postman Setup Guide - Step by Step
Common Error: "Field required" for outfit_photo
This error means Postman isn't sending the file correctly. Follow these exact steps:
✅ Correct Setup in Postman
Step 1: Create the Request
- Click New → HTTP Request
- Set method to POST
- Enter URL:
http://localhost:8000/api/try-on/
Step 2: Configure Body (CRITICAL)
- Click the Body tab
- Select form-data (NOT raw, NOT x-www-form-urlencoded)
- You should see a table with columns: Key | Value | Description
Step 3: Add First File Field
- In the Key column, type exactly:
user_photo - Click the dropdown on the right side of that row (it will say "Text" by default)
- Change it to File (NOT Text!)
- Click Select Files button that appears
- Choose your user photo image file
Step 4: Add Second File Field
- Click Add Row or just click in a new row
- In the Key column, type exactly:
outfit_photo - Click the dropdown on the right side (change from "Text" to File)
- Click Select Files button
- Choose your outfit photo image file
Step 5: Verify Setup
Your form-data should look like this:
Key | Type | Value
-------------|------|----------
user_photo | File | [your file name]
outfit_photo | File | [your file name]
Step 6: Send Request
- Click Send
- You should receive a PNG image as the response
❌ Common Mistakes
-
Using "Text" instead of "File" - This is the #1 mistake!
- Wrong: Key =
outfit_photo, Type = Text, Value = file path - Right: Key =
outfit_photo, Type = File, Value = [Select Files button]
- Wrong: Key =
-
Using wrong body type
- Wrong: Body = raw (JSON)
- Wrong: Body = x-www-form-urlencoded
- Right: Body = form-data
-
Wrong field names
- Must be exactly:
user_photoandoutfit_photo(case-sensitive)
- Must be exactly:
-
Missing trailing slash
- Wrong:
http://localhost:8000/api/try-on - Right:
http://localhost:8000/api/try-on/
- Wrong:
Quick Test: Health Check First
Before testing try-on, verify the service is running:
- Create a GET request
- URL:
http://localhost:8000/health - Click Send
- Should return:
{"status": "ok"}
If this fails, your service isn't running!
Visual Checklist
When you look at your Postman request, you should see:
- ✅ Method: POST
- ✅ URL:
http://localhost:8000/api/try-on/ - ✅ Body tab selected
- ✅ "form-data" radio button selected (not raw, not x-www-form-urlencoded)
- ✅ Two rows in the form-data table
- ✅ First row: Key =
user_photo, Type = File (dropdown shows "File") - ✅ Second row: Key =
outfit_photo, Type = File (dropdown shows "File") - ✅ Both rows have file names in the Value column
Still Having Issues?
-
Check service is running:
# If using Docker: docker-compose ps # If using Python directly: # Make sure uvicorn is running -
Check the service logs for more details
-
Try the FastAPI docs:
- Open browser:
http://localhost:8000/docs - Use the interactive Swagger UI to test the endpoint
- This will show you exactly what the API expects
- Open browser: