Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Macro

POST(content:on:_:)

Decodes the request body as Body and passes it to the first non-authentication handler parameter after Request. If Body is also the authentication type, the first parameter of that type receives the body and a later parameter receives the authenticated user. For example: @POST(content: User.self, "users").
@attached(peer, names: prefixed(_route_), prefixed(_register_)) macro POST<Body>(content: Body.Type, on routeBuilder: (any RoutesBuilder)? = nil, _ pathComponents: Any...) where Body : Content