Instance Propertyasync-http-client 1.25.2AsyncHTTPClient
contentLength
Body size. If nil,Transfer-Encoding
will automatically be set to chunked
. Otherwise a Content-Length
header is set with the given contentLength
.
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 contentLength: Int64?
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.
@frozen struct Int64
A 64-bit signed integer value type.
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 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
.