HttpListenerResponse.ContentType 속성

정의

반환된 콘텐츠의 MIME 형식을 가져오거나 설정합니다.

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

속성 값

String

응답의 Content-Type 헤더 텍스트가 들어 있는 String 인스턴스입니다.

예외

Set 작업에 대해 지정된 값이 null입니다.

set 작업에 지정된 값이 빈 문자열("")인 경우

이 개체가 닫혀 있는 경우

설명

웹 브라우저와 통신할 때 이외의 콘텐츠 형식 text/html을 반환할 때 이 속성을 명시적으로 설정해야 합니다.

응답 헤더의 전체 목록은 열거형을 HttpResponseHeader 참조하세요.

적용 대상

추가 정보