FormBody<'T> Type
Marks a route field as coming from a form-encoded request body.
Form fields are converted to JSON then deserialized into the target type.
Numeric strings are handled via JsonNumberHandling.AllowReadingFromString.
At most one body marker (JsonBody<'T> or FormBody<'T>) is allowed per route case.
Example
type LoginInput = { Username: string; Password: string }
type AuthRoute =
| Login of FormBody<LoginInput>
let handle route : HttpHandler =
match route with
| Login (FormBody input) -> authenticate input
type LoginInput =
{
Username: string
Password: string
}
Multiple items
val string: value: 'T -> string
--------------------
type string = System.String
val string: value: 'T -> string
--------------------
type string = System.String
type AuthRoute = | Login of obj
val handle: route: AuthRoute -> 'a
val route: AuthRoute
union case AuthRoute.Login: obj -> AuthRoute
val input: obj
Union cases
| Union case |
Description
|
Full Usage:
FormBody 'T
Parameters:
'T
|
|
Falco.UnionRoutes