tool::http-status-detail
415 Unsupported Media Type
The media type of the request is not supported.
Status Code
415
Name
Unsupported Media Type
Category
4xxDetailed Explanation
HTTP 415 Unsupported Media Type occurs when the server refuses the request because it does not support the media type of the request body. It happens when the Content-Type header is set incorrectly or when the server only accepts specific formats. A classic example in API development is sending form-data to an endpoint that expects JSON.
Common Causes
- ▸Sending text/plain when the endpoint requires application/json
- ▸Sending JSON to a file upload endpoint that requires multipart/form-data
- ▸Sending JSON to a server that expects XML
- ▸A mismatch between the Accept and Content-Type headers
How to Fix
- 1.Check the API documentation and set the correct Content-Type header
- 2.For JSON data: Content-Type: application/json
- 3.For file uploads: Content-Type: multipart/form-data
- 4.Check the response body for the list of supported media types
Related HTTP Headers
Content-TypeAcceptResponse Example
HTTP/1.1 415 Unsupported Media Type
Content-Type: application/json
{"error":"unsupported_media_type","message":"Content-Type must be application/json","supported":["application/json"]}Related Status Codes
400Bad RequestThe server could not understand the request due to invalid syntax.→401UnauthorizedAuthentication is required and has failed or not been provided.→402Payment RequiredReserved for future use; some services use it for payment walls.→403ForbiddenThe server refuses to fulfill the request (authenticated but unauthorized).→404Not FoundThe requested resource could not be found.→
ad · 300×250
// related tools