Name

HttpMethodAttribute

Synopsis

This attribute is used to bind methods in an HttpGetClientProtocol or HttpPostClientProtocol proxy class to web service methods.

The ParameterFormatter property specifies how the proxy encodes parameters before sending them to a web service method. The ReturnFormatter property specifies how the proxy class decodes the web method’s return value. Both values must be set, as there is no default value. Set ReturnFormatter to the UrlParameterWriter type if you are using HTTP GET or the HtmlFormParameterWriter type if you are using HTTP POST. Always set ParameterFormatter to the XmlReturnReader type. An example attribute declaration for HTTP GET is <HttpMethodAttribute(GetType(XmlReturnReader), GetType(UrlParameterWriter))>.

Public NotInheritable Class HttpMethodAttribute : Inherits Attribute
' Public Constructors
   Public Sub New() 
   Public Sub New(ByVal returnFormatter As Type, 
        ByVal parameterFormatter As Type) 
' Public Instance Properties
   Public Property ParameterFormatter As Type  
   Public Property ReturnFormatter As Type  
End Class

Hierarchy

System.ObjectSystem.Attribute HttpMethodAttribute

Valid On

Method

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.