Content
Namespace: WebSharper.Sitelets
Assembly: WebSharper.Sitelets.dll
Server side
Constructors
This type doesn't contain any contructors.
Fields
This type doesn't contain any fields.
Methods
Custom: response:Response → Task<Content>
Creates a custom content.
Custom: Status × seq<Header> × Action<Stream> → Task<Content>
Creates a custom content.
File: string × bool × string → Task<Content>
Creates a content that serves a file from disk.
Forbidden: Task<Content>
Constructs a 403 Forbidden response.
FromContent: c:FSharpContent<obj> → Content
FromContext: f:Func<Context,Task<Content>> → Task<Content>
Creates Content that depends on the Sitelet context.
FromTask: content:Task<Content> → Content
Wraps an asynchronous content.
Json<'U>: x:'U → Task<Content>
Creates a JSON content from the given object.
MapResponse: Task<Content> × Func<Response,Response> → Task<Content>
Modify the response of a content. Transforms any
content to 'CustomContent'.
MapResponseAsync: Task<Content> × Func<Response,Task<Response>> → Task<Content>
Modify the response of a content. Transforms any
content to 'CustomContent'.
MethodNotAllowed: Task<Content>
Constructs a 405 Method Not Allowed response.
NotFound: Task<Content>
Constructs a 404 Not Found response.
Page: INode × INode × string × string → Task<Content>
Creates an HTML content.
Page: page:Page → Task<Content>
Creates an HTML content.
RedirectPermanent: action:obj → Task<Content>
Redirects permanently (301 Moved Permanently) to a given endpoint.
RedirectPermanentToUrl: url:string → Task<Content>
Redirects permanently (301 Moved Permanently) to a given URL.
RedirectTemporary: action:obj → Task<Content>
Redirects temporarily (307 Redirect Temporary) to a given endpoint.
RedirectTemporaryToUrl: url:string → Task<Content>
Redirects temporarily (307 Redirect Temporary) to a given URL.
ServerError: Task<Content>
Constructs a 500 Server Error response.
SetBody: Task<Content> × Action<Stream> → Task<Content>
Set the body writing function of the generated response.
Transforms any content to 'CustomContent'.
SetHeaders: Task<Content> × seq<Header> → Task<Content>
Replace the headers of the generated response. Transforms any
content to 'CustomContent'.
SetHeaders: Task<Content> × Header[] → Task<Content>
Replace the headers of the generated response. Transforms any
content to 'CustomContent'.
SetStatus: Task<Content> × Status → Task<Content>
Set the status of the generated response.
Transforms any content to 'CustomContent'.
SetStatus: Task<Content> × int × string → Task<Content>
Set the status of the generated response.
Transforms any content to 'CustomContent'.
Text: string × Encoding → Task<Content>
Creates a plain text content.
ToResponse: Content × Context → Task<Response>
Generates an HTTP response.
Unauthorized: Task<Content>
Constructs a 401 Unauthorized response.
WithContentType: Task<Content> × string → Task<Content>
Set the Content-Type header.
WithHeader: Task<Content> × string × string → Task<Content>
Add a header to the generated response. Transforms any
content to 'CustomContent'.
WithHeaders: Task<Content> × seq<Header> → Task<Content>
Add headers to the generated response. Transforms any
content to 'CustomContent'.
WithHeaders: Task<Content> × Header[] → Task<Content>
Add headers to the generated response. Transforms any
content to 'CustomContent'.