Compartir vía


WebInvokeAttribute.Method Propiedad

Definición

Obtiene o establece el método de protocolo (por ejemplo HTTP) al que responde la operación de servicio.

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

Valor de propiedad

Método de protocolo asociado a la operación.

Ejemplos

En el ejemplo siguiente se muestra cómo establecer la Method propiedad .

[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

Comentarios

Method el valor predeterminado es POST.

Se aplica a