worldline

Documentation

415 - Unsupported Media Type

Description

The server refused to process the request because the payload was sent in a format that is not supported by this endpoint. This typically happens when the Content-Type header does not match a media type the API can accept, or when the header is missing entirely.

Common Scenarios

  1. Missing Content-Type header : The request was sent without specifying a Content-Type header, so the server cannot determine how to interpret the payload.

  2. Incorrect Content-Type value : The request specifies a media type (e.g. text/plain , multipart/form-data ) that this endpoint does not accept, when application/json is expected.

  3. Mismatched body and header : The request body is formatted differently from what the Content-Type header declares (e.g. header says application/json but the body is XML).

  4. Incorrect character encoding : The Content-Type header specifies a charset that is not supported (e.g. application/json; charset=iso-8859-1 when only UTF-8 is accepted).

  5. SDK or client library misconfiguration : An outdated or misconfigured HTTP client is setting a default Content-Type that does not match the request body.

Resolution Steps

  • Ensure your request includes the Content-Type header, set to the media type expected by the endpoint (typically application/json ).

  • Verify the request body is actually encoded in the format declared by the Content-Type header.

  • Confirm the request is encoded using UTF-8, unless otherwise specified in the endpoint documentation.

  • Check your HTTP client or SDK configuration to ensure it is not overriding or omitting the Content-Type header unexpectedly.

  • Consult the endpoint's documentation to confirm which media type(s) it accepts, as this can vary between endpoints.

Refer to the endpoint documentation for the exact request format and accepted media types.