Client Error

    HTTP 415 Unsupported Media Type

    The server refuses the request because the body is in a format it does not support, or the Content-Type header is missing or wrong.

    Check a URL for HTTP 415

    Paste any URL to see whether it currently returns 415. Runs a live HTTP probe and follows redirects.

    TL;DR

    415 almost always means the Content-Type header does not match what the API expects. Set it to the right value, most often application/json, and make sure the body really is in that format.

    What does HTTP 415 mean?

    HTTP 415 Unsupported Media Type means the server looked at the format of the data being sent and will not process it. The format is declared in the Content-Type header. The usual mistake is sending JSON without saying so, which leaves the default of plain text or form data, or declaring one format and sending another. It can also be returned for a Content-Encoding the server cannot decode.

    Common Causes

    • •Sending JSON without a Content-Type: application/json header
    • •Sending form data to an endpoint that only accepts JSON, or the reverse
    • •Setting Content-Type by hand on a multipart upload and leaving out the boundary
    • •A charset or suffix on the header that a strict server does not recognise
    • •Compressing the body with a Content-Encoding the server does not support

    How to Fix It

    1. 1.Check the API documentation for the Content-Type the endpoint expects
    2. 2.Set the header explicitly: application/json for JSON, application/x-www-form-urlencoded for simple forms
    3. 3.For file uploads, let the HTTP library set multipart/form-data and its boundary for you
    4. 4.Confirm the body matches the header, for example that the JSON is serialised and not sent as an object's default text
    5. 5.If you build the API, list the accepted types in the response, using the Accept-Post header

    SEO Impact

    415 applies to requests that send a body, which search engine crawlers do not do, so it does not normally affect indexing. It matters for forms and API calls that customers rely on.

    Monitor HTTP 415 with LemWatch

    If a form or checkout starts failing with 415 after a release, a client library or a proxy has changed the Content-Type header. Compare a working request with a failing one.

    Frequently Asked Questions about HTTP 415

    What is the difference between 415 and 406?

    415 is about the format of what the client sends. 406 is about the format the client is willing to receive. 415 looks at Content-Type, 406 at Accept.

    Free Website Tools

    Check your site for common issues that cause HTTP errors: