Specifies which HTTP verb is used to invoke a method and the format of the response. This class cannot be inherited.
ScriptMethodAttribute only takes named parameters. The following are the properties of ScriptMethodAttribute that can be used as named parameters:
Specifies whether the method will be invoked by using the HTTP GET command. The default is false. Setting the UseHttpGet property to true might pose a security risk for your application if you are working with sensitive data or transactions.
Specifies whether the response will be serialized as JSON or as XML. The default is Json. The ResponseFormat property is useful for scenarios where the return type of the method is XmlDocument or XmlElement.
Specifies whether all return types, including string types, are serialized as XML. The value of the XmlSerializeString property is ignored when the response is serialized as JSON.
For more information about using attributes, see Extending Metadata Using Attributes.
The following example demonstrates how to apply ScriptMethodAttribute to the GetXmlDocument and EchoStringAndDate methods to specify which HTTP verb to use and the response format.
Assembly: System.Web.Extensions (Module: System.Web.Extensions)