Fixed: "This predictor only supports the following content types ... Got 'application/csv'" in MLflow
I sent a CSV file to an MLflow model server with the Content-Type: application/csv header that MLflow's own guide uses, and the server answered 415 Unsupported Media Type: This predictor only supports the following content types: Types: ['text/csv', 'application/json', 'application/vnd.apache.parquet']. Got 'application/csv'. The server reads CSV only when the request says text/csv, and changing the header fixed it.
What I Was Doing
In Part 9 of the MLflow series, I served the shopper project's champion model on my Mac with mlflow models serve on port 5001, using MLflow 3.18.0. The project has a CSV file of three online shopping sessions, examples/sessions.csv, and I wanted the model's predictions for it.
MLflow's guide to deploying a model as a local inference server says how to send CSV:
The
/invocationsendpoint accepts CSV or JSON inputs. The input format must be specified in the Content-Type header as either application/json or application/csv.
and gives this example:
curl http://127.0.0.1:5000/invocations -H 'Content-Type: application/csv' --data '1,2,3,4'
So I sent the file with that header, from a second terminal in the project folder. --data-binary sends the file exactly as it is, line breaks included:
- macOS / Linux
- Windows (PowerShell)
curl -i http://127.0.0.1:5001/invocations -H "Content-Type: application/csv" --data-binary @examples/sessions.csv
Invoke-RestMethod http://127.0.0.1:5001/invocations -Method Post -ContentType "application/csv" -InFile examples/sessions.csv
What I Expected
The model's predictions for the three sessions, as JSON.
What I Got
- macOS / Linux
- Windows (PowerShell)
HTTP/1.1 415 Unsupported Media Type
date: Thu, 26 Nov 2026 05:23:09 GMT
server: uvicorn
content-length: 155
content-type: text/plain; charset=utf-8
This predictor only supports the following content types: Types: ['text/csv', 'application/json', 'application/vnd.apache.parquet']. Got 'application/csv'.
Invoke-RestMethod: This predictor only supports the following content types: Types: ['text/csv', 'application/json', 'application/vnd.apache.parquet']. Got 'application/csv'.

415 Unsupported Media Type means the server refused the request because of its Content-Type label, before it looked at the data.
What I Checked
The message lists the accepted types: text/csv, application/json and application/vnd.apache.parquet. application/csv isn't one of them.
MLflow's scoring server says the same. In MLflow 3.18.0, mlflow/pyfunc/scoring_server/__init__.py defines the three types and compares the request's type with them exactly:
CONTENT_TYPE_CSV = "text/csv"
CONTENT_TYPE_JSON = "application/json"
CONTENT_TYPE_PARQUET = "application/vnd.apache.parquet"
if mime_type == CONTENT_TYPE_CSV:
So the guide's application/csv can't match.
Why It Happens
The server picks a reader for the body from the Content-Type header: text/csv for CSV, application/json for JSON and application/vnd.apache.parquet for Parquet. Any other type gets 415 before the data is read. MLflow's guide names application/csv, which the server doesn't accept, so its CSV example can't work as written.
The Fix
Send CSV as text/csv:
- macOS / Linux
- Windows (PowerShell)
curl -i http://127.0.0.1:5001/invocations -H "Content-Type: text/csv" --data-binary @examples/sessions.csv
Invoke-RestMethod http://127.0.0.1:5001/invocations -Method Post -ContentType "text/csv" -InFile examples/sessions.csv
After the Fix
- macOS / Linux
- Windows (PowerShell)
HTTP/1.1 200 OK
date: Thu, 26 Nov 2026 05:23:10 GMT
server: uvicorn
content-length: 148
content-type: application/json
{"predictions": [[0.10694143736565398, 0.893058562634346], [0.999142902134051, 0.0008570978659490101], [0.9966742334522005, 0.0033257665477994395]]}
predictions
-----------
{0.106941437365654 0.893058562634346, 0.999142902134051 0.00085709786594901, 0.996674233452201 0.00332576654779944}

The server read the CSV and answered with one pair of probabilities per session, not buying and buying. The whole numbers in the file, such as 3 page visits, were fine: the server reads a CSV body with the column types in the model's signature.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Content-Type: application/csv, as in MLflow's guide | 415 Unsupported Media Type | Content-Type: text/csv |
--data @file.csv instead of --data-binary | curl removes the line breaks, so the rows run together | --data-binary @file.csv |
No Content-Type header with --data | curl labels it application/x-www-form-urlencoded, which is also a 415 | Always set the header |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Got 'application/x-www-form-urlencoded' | The request has no Content-Type header | Add -H "Content-Type: text/csv" |
Incompatible input types for column ... from mlflow models predict -t csv | The command line reads CSV without the signature's types | Use JSON there: Fixed: Incompatible input types for column |
FAQ
Which formats does the server accept?
JSON, in one of MLflow's layouts such as dataframe_split, CSV as text/csv, and Parquet as application/vnd.apache.parquet: How to Send a CSV File to an MLflow Model Server and How to Send a Parquet File to an MLflow Model Server.
Is the CLI's CSV different?
Yes. mlflow models predict -t csv reads the file without the signature's column types, so whole numbers in a decimal column stop it, while the server reads the same file without trouble.
Conclusion
MLflow's model server reads CSV only when the request says Content-Type: text/csv, and answers 415 for the application/csv that MLflow's guide uses. With text/csv, the same file got the three sessions' predictions.
Additional Resources
- Deploy MLflow Model as a Local Inference Server — the endpoints and the input formats.
- curl --data-binary — sending a file without changing it.
- 415 Unsupported Media Type — what the status code means.
