WebRequest.RegisterPrefix(String, IWebRequestCreate) 메서드

정의

지정된 URI에 WebRequest 대한 하위 항목을 등록합니다.

public:
 static bool RegisterPrefix(System::String ^ prefix, System::Net::IWebRequestCreate ^ creator);
public static bool RegisterPrefix(string prefix, System.Net.IWebRequestCreate creator);
static member RegisterPrefix : string * System.Net.IWebRequestCreate -> bool
Public Shared Function RegisterPrefix (prefix As String, creator As IWebRequestCreate) As Boolean

매개 변수

prefix
String

하위 서비스가 제공하는 WebRequest 전체 URI 또는 URI 접두사입니다.

creator
IWebRequestCreate

하위 항목을 만들기 위해 호출하는 WebRequest create WebRequest 메서드입니다.

반품

등록에 성공하면

예외

prefixnull인 경우

-또는-

creatornull입니다.

설명

Caution

WebRequest, HttpWebRequest, ServicePointWebClient 사용되지 않으므로 새 개발에 사용하면 안 됩니다. HttpClient를 대신 사용하세요.

메서드는 RegisterPrefix 서비스 요청에 하위 항목을 등록 WebRequest 합니다. WebRequest 하위 항목은 일반적으로 HTTP 또는 FTP와 같은 특정 프로토콜을 처리하도록 등록되지만 서버의 특정 서버 또는 경로에 대한 요청을 처리하도록 등록할 수 있습니다.

미리 등록된 예약 유형은 다음과 같습니다.

  • http://

  • https://

  • ftp://

  • file://

자세한 내용은 및 Create(String) 메서드를 Create(Uri) 참조하세요.

중복된 접두사는 허용되지 않습니다. RegisterPrefix 는 중복 접두사를 등록하려고 하면 를 반환 false 합니다.

메모

클래스는 HttpWebRequest 기본적으로 HTTP 및 HTTPS 스키마에 대한 서비스 요청에 등록됩니다. 이러한 스키마에 대해 다른 WebRequest 하위 항목을 등록하려고 하면 실패합니다.

적용 대상