Bagikan melalui


WebInvokeAttribute.Method Properti

Definisi

Mendapatkan atau mengatur metode protokol (misalnya HTTP) yang ditanggapi operasi layanan.

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

Nilai Properti

Metode protokol yang terkait dengan operasi.

Contoh

Contoh berikut menunjukkan cara mengatur Method properti.

[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "Mod?x={x}&y={y}")]
long Mod(long x, long y);
 <OperationContract()> _
<WebInvoke(Method:="POST", UriTemplate:="Mod?x={x}&y={y}")> _
Function Modulo(ByVal x As Long, ByVal y As Long) As Long

Keterangan

Method default ke POST.

Berlaku untuk