다음을 통해 공유


Sys.Net.WebRequest.getResolvedUrl 메서드

업데이트: 2007년 11월

Sys.Net.WebRequest 인스턴스의 확인된 URL을 가져옵니다.

var requestUrl = MyWebRequest.getResolvedUrl();

매개 변수

매개 변수

설명

value

웹 요청이 전송되는 URL을 나타내는 문자열입니다.

예외

예외 형식

조건

Sys.ArgumentNullException

value가 null인 경우

반환 값

웹 요청이 전송되는 확인된 URL입니다.

설명

이 메서드는 WebRequest 인스턴스와 연결된 URL의 절대 URL 표현을 반환합니다. 이 URL에는 프로토콜 식별자와 정규화된 도메인 이름이 포함됩니다. 이 메서드는 네트워크 실행자와 같은 다른 클래스에서 웹 요청의 대상 URL을 확인하기 위해 사용됩니다.

예제

다음 예제에서는 WebRequest 인스턴스의 확인된 URL을 설정하고 가져오는 방법을 보여 줍니다. 이 코드는 WebRequest 클래스 개요에서 볼 수 있는 전체 예제의 일부입니다.

// This function gets the resolved Url 
// of the Web request instance.
function GetWebRequestResolvedUrl()
{    
    // Instantiate the WebRequest.
    var wRequest =  new Sys.Net.WebRequest();

    // Set the request Url.  
    wRequest.set_url(getPage);  

    // Get the web request completed event handler.
    var resUrl = wRequest.getResolvedUrl();   
    alert("Resolved Url: " + resUrl);

    // Set the web request completed event handler,
    // for processing return data.
    wRequest.add_completed(OnWebRequestCompleted); 

    // Execute the request.
    wRequest.invoke();  
}

참고 항목

참조

Sys.Net.WebRequestManager 클래스

Sys.Net.WebRequestExecutor 클래스

Sys.Net.XMLHttpExecutor 클래스