stream
Body chunk provider.
var stream: (StreamWriter) -> EventLoopFuture<Void>
Body chunk provider.
var stream: (StreamWriter) -> EventLoopFuture<Void>
s15AsyncHTTPClient0B0C4BodyV6streamy7NIOCore15EventLoopFutureCyytGAE12StreamWriterVYbcvp
What are these?6XKK7
import AsyncHTTPClient
This package provides simple HTTP Client library built on top of SwiftNIO.
struct Body
A request body.
class HTTPClient
HTTPClient class provides API for request execution.
struct StreamWriter
A streaming uploader.
final class EventLoopFuture<Value>
Holder for a result that will be provided later.
typealias Void = ()
The return type of functions that don’t explicitly specify a return type, that is, an empty tuple ()
.
static func byteBuffer(_ buffer: ByteBuffer) -> Body
Create and stream body using ByteBuffer
.
@preconcurrency static func bytes<Bytes>(_ bytes: Bytes) -> Body where Bytes : RandomAccessCollection, Bytes : Sendable, Bytes.Element == UInt8
Create and stream body using a collection of bytes.
static func data(_ data: Data) -> HTTPClient.Body
Create and stream body using Data
.
static func stream(contentLength: Int64? = nil, _ stream: @escaping (StreamWriter) -> EventLoopFuture<Void>) -> Body
Create and stream body using StreamWriter
.
@preconcurrency static func stream(length: Int? = nil, _ stream: @escaping (StreamWriter) -> EventLoopFuture<Void>) -> Body
Create and stream body using StreamWriter
.
static func string(_ string: String) -> Body
Create and stream body using String
.
var contentLength: Int64?
Body size. If nil,Transfer-Encoding
will automatically be set to chunked
. Otherwise a Content-Length
header is set with the given contentLength
.
var length: Int? { get set }
Body size. If nil,Transfer-Encoding
will automatically be set to chunked
. Otherwise a Content-Length
header is set with the given length
.