TokenReply

Loading…

Reload

Content-Type mismatch

The request body encoding does not match the Content-Type header or operation requirements.

Last checked · Sources: TokenReply code and documentation review; upstream wording may vary

Area
Request format
Typical response
HTTP 400
Retry?
No, send the expected media type

Symptoms

  • A JSON endpoint cannot parse the body, or an upload endpoint rejects JSON.
  • TokenReply reports that the model name is missing even though the body contains one, because a body sent as text/plain is not read as JSON.
  • The payload is correct in curl but changed by a workflow or browser client.

Likely causes

  • JSON is sent as text/plain or form data.
  • A multipart upload is forced through application/json.

How to diagnose

  • Inspect the final Content-Type including its boundary.
  • Confirm the serialized body matches that media type.
  • Use the minimal example for the exact operation.

Fixes

  • Use application/json for JSON API bodies.
  • Let the HTTP library generate multipart boundaries for file uploads.
  • Do not manually reuse headers across unrelated endpoint types.

How to verify

The server parses the body and advances to request or model validation.

Resources