Bagikan melalui


HttpRequest.RequestType Properti

Definisi

Mendapatkan atau mengatur metode transfer data HTTP (GET atau POST) yang digunakan oleh klien.

public:
 property System::String ^ RequestType { System::String ^ get(); void set(System::String ^ value); };
public string RequestType { get; set; }
member this.RequestType : string with get, set
Public Property RequestType As String

Nilai Properti

String yang mewakili jenis pemanggilan HTTP yang dikirim oleh klien.

Contoh

Contoh kode berikut menggunakan HtmlEncode metode untuk mengodekan HTML nilai RequestType properti dan WriteLine metode untuk menulis nilai yang dikodekan ke file. Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk HttpRequest kelas .

// 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))

Berlaku untuk