HTTP 415 Unsupported Media Type — Wrong Content-Type
About HTTP 415 Unsupported Media Type
HTTP 415 Unsupported Media Type means the server does not support the request Content-Type. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.
Here are the key things to understand: Status: 415 Unsupported Media Type. Category: 4xx Client Error. Server cannot process the content type. Check Accept and Content-Type headers. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: Sending form data to a JSON-only endpoint. Missing Content-Type header. Using XML when server expects JSON. File type not accepted by upload endpoint. Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Set Content-Type: application/json for JSON APIs. Check API docs for accepted content types. Ensure file uploads use multipart/form-data. Match the Content-Type to what the server expects. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.
This article is part of our HTTP Status Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.
Quick Answer
How to fix 415?
Set the correct Content-Type header matching what the API expects.
Overview
HTTP 415 Unsupported Media Type means the server does not support the request Content-Type.
Key Details
- Status: 415 Unsupported Media Type
- Category: 4xx Client Error
- Server cannot process the content type
- Check Accept and Content-Type headers
Common Causes
- Sending form data to a JSON-only endpoint
- Missing Content-Type header
- Using XML when server expects JSON
- File type not accepted by upload endpoint
Steps
- 1Set Content-Type: application/json for JSON APIs
- 2Check API docs for accepted content types
- 3Ensure file uploads use multipart/form-data
- 4Match the Content-Type to what the server expects