Unsupported media type
Identifiers
Section titled “Identifiers”| Field | Value |
|---|---|
| Type URI | https://echo.labstack.com/pro/problems/unsupported-media-type |
| Code | unsupported_media_type |
| HTTP status | 415 |
| HTTP status | English title |
|---|---|
| 415 | Unsupported Media Type |
When it occurs
Section titled “When it occurs”The application’s request binding does not support the request’s Content-Type. The application returns this code only where it knows the binder refused the media type.
Client handling
Section titled “Client handling”Send the body with a media type that the API documents, for example application/json.
Example response
Section titled “Example response”If your application installs a custom handler, the body may differ.
HTTP/1.1 415 Unsupported Media TypeContent-Type: application/problem+json
{ "code": "unsupported_media_type", "status": 415, "title": "Unsupported Media Type", "type": "https://echo.labstack.com/pro/problems/unsupported-media-type"}Server correction
Section titled “Server correction”Keep documented media types aligned with the binder and validator. Clients must set a matching Content-Type before retrying.
Response fields
Section titled “Response fields”Your application (problem.NewError)
Section titled “Your application (problem.NewError)”type(string, always): The exact type URI above.title(string, always): The catalog title in the rendered language: English by default, Japanese only when the application selects it.status(integer, always): The HTTP status of the response.code(string, always): The stable code above.detail(string, optional): Display text that your application sets, up to 256 bytes withproblem.NewError. Omitted when you set none.
Headers:
Cache-Control(conditional):no-store, set byproblem/echoadapter.Content-Language(conditional):enorja, set byproblem/echoadapterfrom its configured language.
Notes:
- The adapter keeps existing
WWW-Authenticate,AllowandRetry-Afterheaders and adds no challenge or retry advice of its own. - On HEAD, the adapter’s
Content-Lengthequals the GET body’s length.
Related behavior
Section titled “Related behavior”See the problem catalog for application error handling.