HttpResponseMessageProperty 클래스

정의

HTTP 프로토콜을 통한 요청에 사용 가능한 추가 정보에 액세스하고 응답할 수 있도록 HTTP 응답에 대한 액세스를 제공합니다.

public ref class HttpResponseMessageProperty sealed : System::ServiceModel::Channels::IMessageProperty
public ref class HttpResponseMessageProperty sealed
public sealed class HttpResponseMessageProperty : System.ServiceModel.Channels.IMessageProperty
public sealed class HttpResponseMessageProperty
type HttpResponseMessageProperty = class
    interface IMessageProperty
type HttpResponseMessageProperty = class
Public NotInheritable Class HttpResponseMessageProperty
Implements IMessageProperty
Public NotInheritable Class HttpResponseMessageProperty
상속
HttpResponseMessageProperty
구현

예제

클래스의 HttpResponseProperty 인스턴스를 만들고 해당 멤버 중 일부를 수정하는 방법을 보여줍니다.

HttpResponseMessageProperty responseProperty =
    new HttpResponseMessageProperty();
responseProperty.StatusCode = HttpStatusCode.OK;
responseProperty.Headers.Add(
                 HttpResponseHeader.ContentType,
                 "text/html; charset=UTF-8");

설명

HTTP 관련 정보를 캡슐화하는 데 사용할 수 있는 HTTP 응답 정보에 직접 액세스할 수 있는 범용 클래스입니다. 이 클래스의 한 가지 사용은 REST(Representational State Transfer) 아키텍처에 따라 구현된 서비스를 지원하는 것입니다.

이 클래스를 사용하면 다음 시나리오를 지원할 수 있습니다.

  • 엔터티 본문이 전송되는지 여부를 제어합니다.

  • 각 응답에 대해 HTTP 헤더(키, 값) 쌍을 설정할 수 있습니다.

  • 각 응답에 사용되는 상태 코드 및 상태 설명에 따라 다릅니다.

이 클래스는 관련 클래스에서 HttpTransportBindingElement 사용할 수 있습니다.

생성자

HttpResponseMessageProperty()

HttpResponseMessageProperty 클래스의 새 인스턴스를 초기화합니다.

속성

Headers

HTTP 응답에서 HTTP 헤더를 가져옵니다.

Name

HttpResponseMessageProperty 클래스와 연결된 메시지 속성의 이름을 가져옵니다.

StatusCode

이 속성이 연결된 현재 HTTP 응답의 상태 코드를 가져오거나 설정합니다.

StatusDescription

이 속성이 연결된 현재 HTTP 응답의 상태 코드에 대한 설명을 가져오거나 설정합니다.

SuppressEntityBody

메시지 본문을 무시하고 빈 메시지만 보내는지 여부를 나타내는 값을 가져오거나 설정합니다.

SuppressPreamble

메시지 프리앰블이 표시되지 않는지 여부를 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IMessageProperty.CreateCopy()

현재 인스턴스의 새 복사본을 만듭니다.

적용 대상