Website Errors

How to Fix 415 Unsupported Media Type Error

415 Unsupported Media TypePlain English: the server refused your upload or request because the format of the data you sent is not one it supports for that page or endpoint.
Quick answer: A 415 Unsupported Media Type error means the server rejected your request because its format is not supported. Start by matching the Content-Type header to what the server expects, converting the file to an accepted format, and checking the uploader's extension and size rules. API users should set the header explicitly in their client. Site owners may need to register the missing media type on the server. The full steps are below.

What 415 Unsupported Media Type means

Every request your browser or app sends carries a Content-Type header that tells the server what kind of data is inside: application/json for API data, image/png for a picture, multipart/form-data for a file upload. HTTP status 415, Unsupported Media Type, means the server looked at that format and decided it does not support it for the resource you asked for, so it refused the request without processing it. The connection itself is fine and the page or API exists; only the format of what you sent is the problem.

You will usually meet a 415 in three places. The first is file uploads: a site that accepts JPEG and PNG images refuses a WebP or HEIC photo, or a document uploader that takes PDF and DOCX refuses an ODT file. The second is APIs: a client sends XML or form data to an endpoint that only parses JSON, or a form forgets its multipart encoding and arrives as plain form data. The third is server configuration: the server has never been told about a newer format, so it rejects uploads it should accept. Because the fix depends on which side is wrong, the steps below start with the request, then move to the server.

Common causes

How to fix the 415 Unsupported Media Type error — step by step

Start with the visitor and API steps (1–4). If you control the site, steps 5–6 are where most persistent 415 errors get fixed.

  1. Match the Content-Type to what the server expects. A 415 almost always means a format mismatch, so start by finding out which media type the server actually accepts. Read the API documentation or the upload form's instructions: most web APIs expect application/json, while file uploads usually need multipart/form-data. If you are using a form, make sure it carries enctype=multipart/form-data, because a plain form sends application/x-www-form-urlencoded and a server expecting a file upload will reject it with a 415. If you are calling an API, set the Content-Type header explicitly to the documented value and resend the request. When the header matches what the server accepts, the same payload usually goes through on the next try.
  2. Convert the file to a format the site accepts. If you are uploading a file, the file itself may be in a format the site does not support. A site that accepts JPEG and PNG images will refuse a WebP or HEIC photo, and a document uploader that takes PDF and DOCX will refuse an ODT or Pages file. Check the uploader's allowed list, which usually appears next to the upload button, then convert the file: open an image in an editor and export it as JPEG or PNG, or open a document and save it as PDF or DOCX. Make sure the file extension matches the real format after converting, because a renamed file with the wrong contents can still be rejected. Upload the converted file and confirm it is accepted.
  3. Set the correct header in your API client or curl command. API clients sometimes send the wrong Content-Type without telling you. In Postman, open the Body tab, pick the matching format (raw JSON, form-data, or x-www-form-urlencoded), and check that the Headers tab shows the Content-Type you intend; Postman sets it automatically from the Body choice, but a manually added header can override it with the wrong value. In curl, pass the header explicitly, for example curl -X POST -H Content-Type: application/json -d @data.json https://example.com/api/upload, replacing the URL and file with your own. If the body is JSON, also confirm it is valid JSON, because a malformed body can make a server misread the format and answer with a 415 instead of a 400.
  4. Check the upload rules: extension, size, and encoding. Even a supported format can be refused if it breaks another upload rule, so check the full list of requirements. Some uploaders whitelist specific extensions, so a .jpeg file may be rejected where .jpg is allowed, or an uppercase .PNG may fail a case-sensitive check; rename the file to the exact lowercase extension the site lists. Confirm the file is under the size limit and that its charset or encoding matches what the server expects, especially for CSV and text uploads, where a UTF-16 file sent as UTF-8 can be misread. If you are sending a multipart upload, make sure the boundary in the Content-Type header matches the boundaries in the body, because a broken multipart structure reads as an unsupported media type.
  5. Site owner: register the missing media type on the server. If you own the site and legitimate uploads are being rejected, the server may simply not know the media type. In Apache, add the type with AddType, for example AddType image/webp .webp in .htaccess or the virtual host configuration. In Nginx, add the mapping to the mime.types file and reload the configuration. In IIS, add the extension under MIME Types in IIS Manager or with a mimeMap entry in web.config. For APIs, check that your framework's content negotiation accepts the type the client sends: a JSON-only endpoint returns 415 for XML bodies by design, so either document the accepted type clearly or add a parser for the format your clients actually use. Restart or reload the server and retest the same upload.
  6. Rule out cache, extensions, and proxies stripping the header. If the same request works for other people but fails for you, something between you and the server may be changing the request. Test in an incognito window with extensions disabled, then try a different browser and your phone's mobile data to bypass any proxy or VPN. Browser extensions, ad blockers, and corporate proxies can strip or rewrite the Content-Type header, which makes a perfectly good request look unsupported when it reaches the server. Clear the browser cache for the site as well, since a cached error page can keep showing a 415 after the real problem is fixed. If the request succeeds on mobile data but not on your office network, the proxy is the prime suspect.

Did this fix it? Quick checklist

If the error only appears on one site or one endpoint, that site's accepted-format list or server configuration is the prime suspect, and a converted file or corrected header usually works around it. If it appears everywhere at once, a proxy, VPN, or browser extension rewriting your requests is more likely: test in incognito first, then test on mobile data before changing anything else.

Frequently asked questions

What does a 415 Unsupported Media Type error mean?

It means the server refused your request because the media type of the data you sent is not supported for that endpoint. Every request carries a Content-Type that describes its format, such as application/json for API data or image/png for a picture. If the server does not accept that format for the resource you asked for, it answers with a 415 instead of processing the request.

Is a 415 error the visitor's fault or the server's fault?

It can be either. Most often the request itself is at fault: the wrong Content-Type header, a file in an unsupported format, or a form missing its multipart encoding. But it can also be the server's fault if it fails to register a media type it should accept, or if its documentation promises a format its code rejects. Start by fixing the request, and if a correct request still fails, the server's configuration is the likely cause.

What is the difference between a 415, a 400, and a 406 error?

A 415 means the format of the data you sent is not supported by the server. A 400 means the request itself is malformed or invalid, such as broken JSON syntax. A 406 means the server cannot produce a response in any format your Accept header asks for, which is the reverse direction: 415 is about what you sent, 406 is about what you want back.

How do API developers fix a persistent 415 error?

First confirm exactly which Content-Type the client is sending, using the server logs or a tool like Postman, and compare it with what the endpoint accepts. Then either fix the client to send the documented type, or add support for the type on the server: register the MIME type, add the matching body parser, and make sure content negotiation is configured for it. Document the accepted types clearly so clients do not have to guess.