PDF download Download Article
Why you are getting this error, what to do about it
PDF download Download Article

The 415 error, or "Unsupported Media Type" error, occurs when a file format is sent in a request that the server doesn't recognize or isn't configured to handle. This is generally a server-side issue that occurs when you are using an API (Application Program Interface). This guide teaches you the causes of this error and how to fix it.

415 Unsupported Media Type Error

A 415 error occurs when the server doesn't recognize the file format in a request. Check the "Content-Type" and "Content-Encoding," headers, as well as the "Accept" headers on the client side. Check the syntax for typos.

Section 1 of 2:

What Causes the Error

PDF download Download Article
  1. If the content in the request does not match the "Content-Type" header, it may return a 415 error code. The client needs to ensure the "Content-Type" header correctly identifies the file type or media file being sent. Fixing this error may require some coding skills.
  2. The server may not be configured to handle the file type that is being sent in the request. You may need to adjust your server or application settings to allow it to accept the files that are being sent.
    Advertisement
  3. This lists all the ways that data may be compressed or packaged so that the server knows how to unpack the data. If the "Content-Encoding" header is incorrect, it will return a 415 error.[1]
  4. This is a problem on the client side. If the client has a missing "Accept" header or it specifies a media type that the server can't process and return, you will receive a 415 error.
  5. Advertisement
Section 2 of 2:

How to Fix the Error

PDF download Download Article
  1. You can either check the server logs or use the developer tools in a web browser to check the "Content-Type" headers and the file type that is being sent in the failing requests. You can also use a tool like Sitechecker.pro to check your code.
  2. Check that the "Content-Type" headers in your request are correct. For example, if you are sending a JSON file, the header should read "Content-Type: application/json;" If it is an image file, the header should read something like "Content-Type: image/jpeg;". If it is a text or HTML file, the header should read "Content-Type: text/html; charset=UTF-8;".
  3. Make sure your request script isn't missing the "Content-Encoding" headers. Make sure they have the correct encoding (i.e., "gzip", "br").
  4. Ensure there are no typos in your script on the client or server side. For example, if the header reads "charset=UTF8" instead of "charset=UTF-8", this could cause a 415 error. It could be something as simple as using the tag "header" instead of "headers" in your script.
  5. Your server may not be configured to accept the requested file format. You may need to adjust your server configuration to allow it to accept the file format or encoding. If it's an encoding problem, you may need to add or adjust your gzip directives or enable specific modules, such as mod_deflate.[2]
  6. If you are using a web application, a CMS such as WordPress, a plug-in or WordPress theme, make sure it is configured to handle the file type in the request. You may need to check the documentation for the web app, plug-in, or theme and see how to add new content type headers. If you need help figuring out how to do this, contact the developer.
  7. Make sure the client can receive the requested file. It's less common for there to be an issue on the client side, but it does happen. For example, if the server receives a JSON file, the client's "Accept" headers should read " Accept: application/json;". If the server is processing a text or HTML file, the client's header should read "Accept: text/html;". Likewise, if the server is processing an image file, it should read "Accept: image/*;" or something similar.
  8. After making changes to fix the error, test your application or website to make sure it can accept the requested file format. If the changes are successful, you should not receive an Error 415. If the problem persists, you may need to contact your server hosting provider or consult a professional programmer with experience in web applications.[3]
  9. Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Request Header or Cookie Too LargeRequest Header or Cookie Too Large: What It Is + Easy Fixes
Error in Body Stream Chat Gpt9 Quick Fixes for "Error in Body Stream" on ChatGPT
504 Gateway Timeout Fix 504 Gateway Timeout Errors (For Users & Webmasters)
Err Http2 Protocol ErrorWhat to Do When You See the ERR_HTTP2_PROTOCOL_ERROR
Error Code 224003What is Error 224003 and How to Fix It
Err Ssl Protocol Error Fix ERR SSL PROTOCOL ERROR in Chrome and Edge
Something Went Wrong Please Try AgainA Guide to Fixing a 'Something Went Wrong' Error on Any Device
Sent As SMS via Server"Sent as SMS via Server" on Android: All Your Questions Answered
There Was a Problem Parsing the Package Fix "There Was a Problem Parsing the Package" on Android
Err Connection ResetWhat Does the CONNECTION_RESET Error Mean & How Do You Fix It?
Error Code 522 Troubleshoot Cloudflare Code 522: Fixes, Workarounds, & More
This Site Cant Be ReachedQuick Ways to Fix "This Site Can't Be Reached"
Invalid Asset Sticker Discord"Invalid Asset" Sticker: Discord Error Explained + Ways to Fix It
An Unexpected Error Has OccurredAn Unexpected Error Has Occurred: Top Fixes for Instagram, Fortnite & More
Advertisement

About This Article

Luigi Oppido
Reviewed by:
Computer & Tech Specialist
This article was reviewed by Luigi Oppido and by wikiHow staff writer, Travis Boylls. Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years. This article has been viewed 2,261 times.
How helpful is this?
Co-authors: 3
Updated: November 8, 2024
Views: 2,261
Categories: Making a Website
Thanks to all authors for creating a page that has been read 2,261 times.

Is this article up to date?

Advertisement