HttpGetOrPostAttribute Class
Specifies that an action supports both HTTP GET and POST methods.
public class HttpGetOrPostAttribute : Microsoft.AspNetCore.Mvc.Routing.HttpMethodAttributeInheritance System.Object → System.Attribute → Microsoft.AspNetCore.Mvc.Routing.HttpMethodAttribute → HttpGetOrPostAttribute
Remarks
This attribute can be applied to an action method to indicate that it should respond to HTTP GET and POST requests. When applied to an action method, it specifies that the method handles requests made with these two HTTP methods. It can be used to support scenarios where a resource can be fetched (GET) or submitted (POST) to the same URL.
Constructors
HttpGetOrPostAttribute() Constructor
Initializes a new instance of the HttpGetOrPostAttribute class without specifying a route template.
public HttpGetOrPostAttribute();HttpGetOrPostAttribute(string) Constructor
Initializes a new instance of the HttpGetOrPostAttribute class with the specified route template.
public HttpGetOrPostAttribute(string template);Parameters
template System.String
The route template. The template may define path segments, parameters, etc., as per routing conventions.