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:ResponseTask<Content>

Creates a custom content.

Custom: Status × seq<Header> × Action<Stream> → Task<Content>

Creates a custom content.

File: string × bool × stringTask<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 × stringTask<Content>

Creates an HTML content.

Page: page:PageTask<Content>

Creates an HTML content.

RedirectPermanent: action:objTask<Content>

Redirects permanently (301 Moved Permanently) to a given endpoint.

RedirectPermanentToUrl: url:stringTask<Content>

Redirects permanently (301 Moved Permanently) to a given URL.

RedirectTemporary: action:objTask<Content>

Redirects temporarily (307 Redirect Temporary) to a given endpoint.

RedirectTemporaryToUrl: url:stringTask<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> × StatusTask<Content>

Set the status of the generated response. Transforms any content to 'CustomContent'.

SetStatus: Task<Content> × int × stringTask<Content>

Set the status of the generated response. Transforms any content to 'CustomContent'.

Text: string × EncodingTask<Content>

Creates a plain text content.

ToResponse: Content × ContextTask<Response>

Generates an HTTP response.

Unauthorized: Task<Content>

Constructs a 401 Unauthorized response.

WithContentType: Task<Content> × stringTask<Content>

Set the Content-Type header.

WithHeader: Task<Content> × string × stringTask<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'.