Vapor Documentation Beta

Enumeration HTTPBody​Stream​Strategy

public enum HTTPBodyStreamStrategy

Determines how an incoming HTTP request's body is collected.

Enumeration Cases

stream

case stream

The HTTP request's body will not be collected first before the route handler is called and will arrive in zero or more chunks.

collect

case collect(maxSize: ByteCount?)

The HTTP request's body will be collected into memory before the route handler is called.

maxSize Limits the maximum amount of memory in bytes that will be used to collect a streaming body. Streaming requests exceeding that size will result in an error. Passing nil results in the application's default max body size being used. This parameter does not affect non-streaming requests.

Properties

collect

var collect: HTTPBodyStreamStrategy

The HTTP request's body will be collected into memory up to a maximum size before the route handler is called. The application's configured default max body size will be used unless otherwise specified.

See collect(maxSize:) to specify a custom max collection size.