byteBuffer(_:)
Create and stream body using ByteBuffer
.
static func byteBuffer(_ buffer: ByteBuffer) -> Body
Parameters
- buffer
Body
ByteBuffer
representation.
Create and stream body using ByteBuffer
.
static func byteBuffer(_ buffer: ByteBuffer) -> Body
s15AsyncHTTPClient0B0C4BodyV10byteBufferyAE7NIOCore04ByteE0VFZ
What are these?3MYYX
Body ByteBuffer
representation.
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 ByteBuffer
ByteBuffer
stores contiguously allocated raw bytes. It is a random and sequential accessible sequence of zero or more bytes (octets).
@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 stream: (StreamWriter) -> EventLoopFuture<Void>
Body chunk provider.
struct StreamWriter
A streaming uploader.
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
.