Skip to content

Unsupported media type

unsupported_media_typeHTTP 415Retrying the same request will not help

The request body is in a format this endpoint does not read.

Why it happens

  • A missing or different Content-Type. The endpoint reads application/rayfold+json, application/json and the binary application/rayfold; the MCP endpoint reads application/json.
  • Only these types are accepted so that a web page on another site cannot send a form that the server would act on.

What to do

  • Set Content-Type: application/rayfold+json on the request. The client libraries do this for you.

What it looks like

Inside a batch, the operation's frame carries it:

json
{
  "id": 1,
  "error": {
    "code": "invalid_argument",
    "message": "Content-Type text/plain is not accepted; send application/rayfold+json"
  },
  "fin": true
}

When the whole request is refused over HTTP, the answer is a problem document:

json
{
  "type": "https://eddyboutros.github.io/rayfold/errors/unsupported_media_type",
  "title": "unsupported media type",
  "status": 415,
  "detail": "Content-Type text/plain is not accepted; send application/rayfold+json",
  "code": "invalid_argument"
}

See also all error types and the errors chapter of the specification.

Released under the Apache-2.0 license.