HttpWebRequest.Address 속성

정의

요청에 실제로 응답하는 인터넷 리소스의 URI(Uniform Resource Identifier)를 가져옵니다.

public:
 property Uri ^ Address { Uri ^ get(); };
public Uri Address { get; }
member this.Address : Uri
Public ReadOnly Property Address As Uri

속성 값

Uri

요청에 실제로 응답하는 인터넷 리소스를 식별하는 Uri입니다. 기본값은 요청을 초기화하기 위해 Create(String) 메서드가 사용한 URI입니다.

예제

다음 코드 예제에서는 개체가 HttpWebRequest 요청을 수행하기 위해 다른 위치로 리디렉션되었는지 확인하고, 요청이 리디렉션된 경우 변수 값을 hasChangedtrue 설정하고, 그렇지 않으면 hasChangedfalse설정합니다.req

bool hasChanged = req->RequestUri->Equals( req->Address );
bool hasChanged = (req.RequestUri != req.Address);
Dim hasChanged As Boolean = _
   (req.RequestUri.ToString() <> req.Address.ToString())

설명

속성은 Address 요청 중에 발생하는 리디렉션이 완료된 후 URI로 설정됩니다.

원래 요청의 URI는 속성에 RequestUri 유지됩니다.

적용 대상