HttpListenerRequest.HttpMethod 속성

정의

클라이언트에서 지정한 HTTP 메서드를 가져옵니다.

public:
 property System::String ^ HttpMethod { System::String ^ get(); };
public string HttpMethod { get; }
member this.HttpMethod : string
Public ReadOnly Property HttpMethod As String

속성 값

String

요청에 사용된 메서드가 들어 있는 String입니다.

예제

다음 코드 예제에서는이 속성을 사용 하 여 보여 줍니다.

public static void ShowRequestProperties2 (HttpListenerRequest request)
{
    Console.WriteLine("KeepAlive: {0}", request.KeepAlive);
    Console.WriteLine("Local end point: {0}", request.LocalEndPoint.ToString());
    Console.WriteLine("Remote end point: {0}", request.RemoteEndPoint.ToString());
    Console.WriteLine("Is local? {0}", request.IsLocal);
    Console.WriteLine("HTTP method: {0}", request.HttpMethod);
    Console.WriteLine("Protocol version: {0}", request.ProtocolVersion);
    Console.WriteLine("Is authenticated: {0}", request.IsAuthenticated);
    Console.WriteLine("Is secure: {0}", request.IsSecureConnection);
}
Public Shared Sub ShowRequestProperties2(ByVal request As HttpListenerRequest)
    Console.WriteLine("KeepAlive: {0}", request.KeepAlive)
    Console.WriteLine("Local end point: {0}", request.LocalEndPoint.ToString())
    Console.WriteLine("Remote end point: {0}", request.RemoteEndPoint.ToString())
    Console.WriteLine("Is local? {0}", request.IsLocal)
    Console.WriteLine("HTTP method: {0}", request.HttpMethod)
    Console.WriteLine("Protocol version: {0}", request.ProtocolVersion)
    Console.WriteLine("Is authenticated: {0}", request.IsAuthenticated)
    Console.WriteLine("Is secure: {0}", request.IsSecureConnection)
End Sub

설명

HTTP 메서드는 클라이언트에서 원하는 작업에 따라 일반적으로 GET 또는 POST입니다.

적용 대상

추가 정보