Posts Module
Contains operations for adding HTTP POST
endpoints.
Example
let app =
webApp {
post "/api/clowns" (fun (db : IDataAccess) newId clown ->
let clown = dataAccess.Create (newId (), clown)
Results.Created ($"/clowns/{clown.Id}", clown))
}
let app =
webApp {
post "/clowns" [
Status201Created, typeof<Dtos.Get.Clown>
Status400BadRequest, typeof<ValidationProblemDetails>
Status409Conflict, typeof<string>
Status500InternalServerError, typeof<ProblemDetails>
] (fun (logger : ILogger<Program>) mkId (db : IDataAccess) clown ->
// ...
Results.Created ($"/clowns/{id}", clown)
) (fun routeHandler ->
routeHandler.Accepts (typeof<Dtos.Create.Clown>, MediaTypeNames.Application.Json)
routeHandler.AddFilter<MyEndpointFilter> ()
)
}
val string: value: 'T -> string
--------------------
type string = System.String
Type extensions
Type extension | Description |
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b>
?configure : RouteHandlerBuilder -> 'a0
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c>
?configure : RouteHandlerBuilder -> 'd
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd>
?configure : RouteHandlerBuilder -> 'e
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e>
?configure : RouteHandlerBuilder -> 'f
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f>
?configure : RouteHandlerBuilder -> 'g
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g>
?configure : RouteHandlerBuilder -> 'h
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>
?configure : RouteHandlerBuilder -> 'i
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i>
?configure : RouteHandlerBuilder -> 'j
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j>
?configure : RouteHandlerBuilder -> 'k
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>
?configure : RouteHandlerBuilder -> 'l
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l>
?configure : RouteHandlerBuilder -> 'm
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm>
?configure : RouteHandlerBuilder -> 'n
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n>
?configure : RouteHandlerBuilder -> 'o
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o>
?configure : RouteHandlerBuilder -> 'p
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p>
?configure : RouteHandlerBuilder -> 'q
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, 'q>
?configure : RouteHandlerBuilder -> 'r
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b>
?configure : RouteHandlerBuilder -> 'a0
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c>
?configure : RouteHandlerBuilder -> 'd
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd>
?configure : RouteHandlerBuilder -> 'e
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e>
?configure : RouteHandlerBuilder -> 'f
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f>
?configure : RouteHandlerBuilder -> 'g
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g>
?configure : RouteHandlerBuilder -> 'h
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>
?configure : RouteHandlerBuilder -> 'i
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i>
?configure : RouteHandlerBuilder -> 'j
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j>
?configure : RouteHandlerBuilder -> 'k
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>
?configure : RouteHandlerBuilder -> 'l
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l>
?configure : RouteHandlerBuilder -> 'm
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm>
?configure : RouteHandlerBuilder -> 'n
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n>
?configure : RouteHandlerBuilder -> 'o
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o>
?configure : RouteHandlerBuilder -> 'p
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p>
?configure : RouteHandlerBuilder -> 'q
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, 'q>
?configure : RouteHandlerBuilder -> 'r
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b>
?configure : RouteHandlerBuilder -> 'c
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c>
?configure : RouteHandlerBuilder -> 'd
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd>
?configure : RouteHandlerBuilder -> 'e
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e>
?configure : RouteHandlerBuilder -> 'f
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f>
?configure : RouteHandlerBuilder -> 'g
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g>
?configure : RouteHandlerBuilder -> 'h
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>
?configure : RouteHandlerBuilder -> 'i
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i>
?configure : RouteHandlerBuilder -> 'j
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j>
?configure : RouteHandlerBuilder -> 'k
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>
?configure : RouteHandlerBuilder -> 'l
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l>
?configure : RouteHandlerBuilder -> 'm
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm>
?configure : RouteHandlerBuilder -> 'n
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n>
?configure : RouteHandlerBuilder -> 'o
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o>
?configure : RouteHandlerBuilder -> 'p
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p>
?configure : RouteHandlerBuilder -> 'q
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern handler ?configure
Parameters:
Pattern
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, 'q>
?configure : RouteHandlerBuilder -> 'r
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b>
?configure : RouteHandlerBuilder -> 'c
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c>
?configure : RouteHandlerBuilder -> 'd
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd>
?configure : RouteHandlerBuilder -> 'e
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e>
?configure : RouteHandlerBuilder -> 'f
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f>
?configure : RouteHandlerBuilder -> 'g
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g>
?configure : RouteHandlerBuilder -> 'h
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>
?configure : RouteHandlerBuilder -> 'i
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i>
?configure : RouteHandlerBuilder -> 'j
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j>
?configure : RouteHandlerBuilder -> 'k
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>
?configure : RouteHandlerBuilder -> 'l
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l>
?configure : RouteHandlerBuilder -> 'm
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm>
?configure : RouteHandlerBuilder -> 'n
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n>
?configure : RouteHandlerBuilder -> 'o
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o>
?configure : RouteHandlerBuilder -> 'p
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p>
?configure : RouteHandlerBuilder -> 'q
Returns: WebApplication
|
Extended Type:
|
Full Usage:
post pattern produces handler ?configure
Parameters:
Pattern
produces : (int * Type) list
handler : Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, 'q>
?configure : RouteHandlerBuilder -> 'r
Returns: WebApplication
|
Extended Type:
|