HttpRequest.ContentType プロパティ

定義

受信要求の MIME コンテンツ タイプを取得または設定します。

public:
 property System::String ^ ContentType { System::String ^ get(); void set(System::String ^ value); };
public string ContentType { get; set; }
member this.ContentType : string with get, set
Public Property ContentType As String

プロパティ値

受信要求の MIME コンテンツ タイプを表す文字列 (例: "text/html")。 その他の一般的な MIME の種類としては、"audio.wav"、"image/gif"、"application/pdf" などがあります。

次のコード例では、受信要求のコンテンツ タイプを表す値を文字列変数に割り当てます。

String str;
 str = Request.ContentType;

Dim str As String
 str = Request.ContentType
   

次の例は、このコードによって生成される可能性がある出力を示しています。

GET

127.0.0.1

127.0.0.1

GET

適用対象