RouterRegister Help

HTTP Method Attributes

Every route must define the HTTP method(s) it responds to with one of the HTTP method attributes or the Route attribute.

Route

Defines a route that responds to one or more HTTP methods.

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

methods

Method[]

The HTTP methods that the route responds to

<Required>

route

RouteInterface

The route

<Required>

All

Defines a route that responds to all HTTP methods

Equivalent to Route(['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT'], <route>).

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

route

RouteInterface

The route

<Required>

Delete

Defines a route that responds to the DELETE HTTP method.

Equivalent to Route(['DELETE'], <route>).

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

route

RouteInterface

The route

<Required>

Get

Defines a route that responds to the GET HTTP method.

Equivalent to Route(['GET'], <route>).

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

route

RouteInterface

The route

<Required>

GetPost

Convenience attribute for GET and POST methods

Equivalent to Route(['GET', 'POST'], <route>).

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

route

RouteInterface

The route

<Required>

Defines a route that responds to the HEAD HTTP method.

Equivalent to Route(['HEAD'], <route>).

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

route

RouteInterface

The route

<Required>

Options

Defines a route that responds to the OPTIONS HTTP method.

Equivalent to Route(['OPTIONS'], <route>).

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

route

RouteInterface

The route

<Required>

Patch

Defines a route that responds to the PATCH HTTP method.

Equivalent to Route(['PATCH'], <route>).

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

route

RouteInterface

The route

<Required>

Post

Defines a route that responds to the POST HTTP method.

Equivalent to Route(['POST'], <route>).

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

route

RouteInterface

The route

<Required>

Put

Defines a route that responds to the PUT HTTP method.

Equivalent to Route(['PUT'], <route>).

Use On

Action

Cardinality

1

Parameter

Type

Description

Default

route

RouteInterface

The route

<Required>

Last modified: 06 December 2025