HttpResponse.ClearHeaders 메서드

정의

버퍼 스트림에서 모든 헤더를 지웁니다.

public:
 void ClearHeaders();
public void ClearHeaders ();
member this.ClearHeaders : unit -> unit
Public Sub ClearHeaders ()

예외

HTTP 헤더를 보낸 다음에 헤더가 지워진 경우

예제

다음 예제에서는 메서드를 ClearHeaders 호출하여 현재 응답과 함께 헤더가 전송되지 않도록 합니다. 이 기술은 ASP.NET 응답이 JPEG 파일과 같은 이미지를 생성하는 경우에 특히 중요할 수 있습니다. 이 예제에서는 속성이 ContentType image/jpeg로 설정됩니다.

// Clear headers to ensure none
// are sent to the requesting browser
// and set the content type.
Response.ClearHeaders();
Response.ContentType = "image/jpeg";
' Clear headers to ensure none
' are sent to the requesting browser
' and set the content type.
Response.ClearHeaders()
Response.ContentType = "image/jpeg"

적용 대상

추가 정보