-
Chunk provider.
See moreDeclaration
Swift
public struct StreamWriter
-
Body size. Request validation will be failed with
HTTPClientErrors.contentLengthMissing
if nil, unlessTrasfer-Encoding: chunked
header is set.Declaration
Swift
public var length: Int?
-
Body chunk provider.
Declaration
Swift
public var stream: (StreamWriter) -> EventLoopFuture<Void>
-
Create and stream body using
ByteBuffer
.Declaration
Swift
public static func byteBuffer(_ buffer: ByteBuffer) -> Body
Parameters
buffer
Body
ByteBuffer
representation. -
Create and stream body using
StreamWriter
.Declaration
Swift
public static func stream(length: Int? = nil, _ stream: @escaping (StreamWriter) -> EventLoopFuture<Void>) -> Body
Parameters
length
Body size. Request validation will be failed with
HTTPClientErrors.contentLengthMissing
if nil, unlessTransfer-Encoding: chunked
header is set.stream
Body chunk provider.
-
Create and stream body using
Data
.Declaration
Swift
public static func data(_ data: Data) -> Body
Parameters
data
Body
Data
representation. -
Create and stream body using
String
.Declaration
Swift
public static func string(_ string: String) -> Body
Parameters
string
Body
String
representation.