HttpContent Type

Union cases

Union case Description

Bytes byte[]

Full Usage: Bytes byte[]

Parameters:
    Item : byte[]

This tells Suave to respond with an array of bytes. Since most responses are small enough to fit into memory, this is the most used `HttpContent` used as results. If you want a streaming result, use `SocketTask` instead; useful when you're serving large files through Suave.

Item : byte[]

NullContent

Full Usage: NullContent

This is the default `HttpContent`. If you place this in a `HttpResult` the web server won't be that happy. It's assumed by Suave that you place a proper Bytes or SocketTask content as the value – all built-in Http applicates do this properly.

SocketTask Connection * HttpResult -> Task<unit>

Full Usage: SocketTask Connection * HttpResult -> Task<unit>

Parameters:

This task, especially with the `writePreamble`-flag lets your `WebPart` control the flow of bytes by using a `SocketOp`. Contrasting with `Bytes`, setting the `HttpContent` as this discriminated union type lets you stream data back to the client through Suave.

Item : Connection * HttpResult -> Task<unit>

Instance members

Instance member Description

this.IsBytes

Full Usage: this.IsBytes

Returns: bool
Returns: bool

this.IsNullContent

Full Usage: this.IsNullContent

Returns: bool
Returns: bool

this.IsSocketTask

Full Usage: this.IsSocketTask

Returns: bool
Returns: bool