HttpRequest.HttpMethod Tulajdonság

Definíció

Lekéri az ügyfél által használt HTTP-adatátviteli módszert (például GET, POSTvagy HEAD) .

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

Tulajdonság értéke

Az ügyfél által használt HTTP-adatátviteli módszer.

Példák

Az alábbi példakód a metódust használja a HtmlEncode tulajdonság értékének HttpMethod HTML-kódolására, a WriteLine metódus pedig a kódolt érték fájlba írására. Ez a példakód egy nagyobb, az HttpRequest osztályhoz tartozó példa része.

// Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(Request.RequestType));
sw.WriteLine(Server.HtmlEncode(Request.UserHostAddress));
sw.WriteLine(Server.HtmlEncode(Request.UserHostName));
sw.WriteLine(Server.HtmlEncode(Request.HttpMethod));
' Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(Request.RequestType))
sw.WriteLine(Server.HtmlEncode(Request.UserHostAddress))
sw.WriteLine(Server.HtmlEncode(Request.UserHostName))
sw.WriteLine(Server.HtmlEncode(Request.HttpMethod))

Az alábbi példa a kód által előállított kimenetet mutatja be.

GET

127.0.0.1

127.0.0.1

GET

A következőre érvényes: