~/devtools / http-status / 415
tool::http-status-detail

415 Unsupported Media Type

The media type of the request is not supported.

ad · 728×90
ステータスコード
415
名前
Unsupported Media Type
カテゴリ
4xx

詳細説明

HTTP 415 Unsupported Media Typeは、サーバーがリクエストボディのメディアタイプをサポートしていないためリクエストを拒否する際に発生します。Content-Typeヘッダーが誤って設定されているか、サーバーが特定の形式のみ許可する場合に現れます。API開発でJSONを期待するエンドポイントにform-dataを送信するケースが典型的な例です。

主な原因
  • application/jsonが必要なのにtext/plainで送信した場合
  • ファイルアップロードエンドポイントにJSONを送信(multipart/form-dataが必要)
  • XMLを期待するサーバーにJSONを送信した場合
  • AcceptヘッダーとContent-Typeヘッダーの不一致
解決方法
  • 1.APIドキュメントを確認して正しいContent-Typeヘッダーを設定してください
  • 2.JSONデータ送信時: Content-Type: application/json
  • 3.ファイルアップロード時: Content-Type: multipart/form-data
  • 4.レスポンスボディでサポートされているメディアタイプを確認してください

関連HTTPヘッダー

Content-TypeAccept

レスポンス例

HTTP/1.1 415 Unsupported Media Type
Content-Type: application/json

{"error":"unsupported_media_type","message":"Content-Type must be application/json","supported":["application/json"]}

関連ステータスコード

400Bad RequestThe server could not understand the request due to invalid syntax.401UnauthorizedAuthentication is required and has failed or not been provided.402Payment RequiredReserved for future use; some services use it for payment walls.403ForbiddenThe server refuses to fulfill the request (authenticated but unauthorized).404Not FoundThe requested resource could not be found.
ad · 300×250
全ステータスコード一覧に戻る
// related tools
Cron Expression Generator
ビジュアルエディタでcron式を作成・解析。次回5回の実行時刻をプレビューし、よく使うプリセットから始められます。
jwt
JWT Decoder
JWTトークンをデコードして内容を確認。ヘッダー・ペイロード・署名の詳細を表示します。
rx
Regex Tester
リアルタイムでマッチをハイライト表示。グループのキャプチャや説明付きで正規表現をテストできます。
Color Converter
HEX・RGB・HSL形式でカラーコードを変換。カラーピッカーで視覚的に選択できます。