0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MIMEタイプ(メディアタイプ)の指定方法

Last updated at Posted at 2025-01-06

パラメータ

chrasetパラメータ

テキストデータの文字エンコーディングを指定

Content-Type: text/html; charset=UTF-8

qパラメータ

メディアタイプを複数指定する場合に、優先度を指定する

Accept: text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8

text/html, application/xhtml+xml

クライアントはHTML形式とXHTML形式のレスポンスを最も優先して受け入れる。この2つの優先度は同じ。

application/xml;q=0.9

HTMLやXHTMLよりも低い優先度"0.9"でXML形式を受け入れる。

*/*;q=0.8

メディアタイプを受け入れるが、優先度は最も低い。

MIMEタイプの範囲指定

ワイルドカード(*)を使用して、特定のカテゴリのすべてのMIMEタイプを指定可能。

複数の画像形式を受け入れる
Accept: image/*
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?