HttpRequest.ContentType プロパティ

定義

受信要求で使用する MIME の Content-Type を取得または設定します。

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

適用対象