@@ -17,14 +17,14 @@ import NIOCore
1717import NIOHTTP1
1818
1919@available ( macOS 10 . 15 , iOS 13 . 0 , watchOS 6 . 0 , tvOS 13 . 0 , * )
20- struct HTTPClientRequest {
21- var url : String
22- var method : HTTPMethod
23- var headers : HTTPHeaders
20+ public struct HTTPClientRequest {
21+ public var url : String
22+ public var method : HTTPMethod
23+ public var headers : HTTPHeaders
2424
25- var body : Body ?
25+ public var body : Body ?
2626
27- init ( url: String ) {
27+ public init ( url: String ) {
2828 self . url = url
2929 self . method = . GET
3030 self . headers = . init( )
@@ -34,7 +34,7 @@ struct HTTPClientRequest {
3434
3535@available ( macOS 10 . 15 , iOS 13 . 0 , watchOS 6 . 0 , tvOS 13 . 0 , * )
3636extension HTTPClientRequest {
37- struct Body {
37+ public struct Body {
3838 @usableFromInline
3939 internal enum Mode {
4040 case asyncSequence( length: RequestBodyLength , ( ByteBufferAllocator ) async throws -> ByteBuffer ? )
@@ -54,12 +54,12 @@ extension HTTPClientRequest {
5454
5555@available ( macOS 10 . 15 , iOS 13 . 0 , watchOS 6 . 0 , tvOS 13 . 0 , * )
5656extension HTTPClientRequest . Body {
57- static func bytes( _ byteBuffer: ByteBuffer ) -> Self {
57+ public static func bytes( _ byteBuffer: ByteBuffer ) -> Self {
5858 self . init ( . byteBuffer( byteBuffer) )
5959 }
6060
6161 @inlinable
62- static func bytes< Bytes: RandomAccessCollection > (
62+ public static func bytes< Bytes: RandomAccessCollection > (
6363 _ bytes: Bytes
6464 ) -> Self where Bytes. Element == UInt8 {
6565 self . init ( . sequence(
@@ -76,7 +76,7 @@ extension HTTPClientRequest.Body {
7676 }
7777
7878 @inlinable
79- static func bytes< Bytes: Sequence > (
79+ public static func bytes< Bytes: Sequence > (
8080 _ bytes: Bytes ,
8181 length: Length
8282 ) -> Self where Bytes. Element == UInt8 {
@@ -94,7 +94,7 @@ extension HTTPClientRequest.Body {
9494 }
9595
9696 @inlinable
97- static func bytes< Bytes: Collection > (
97+ public static func bytes< Bytes: Collection > (
9898 _ bytes: Bytes ,
9999 length: Length
100100 ) -> Self where Bytes. Element == UInt8 {
@@ -112,7 +112,7 @@ extension HTTPClientRequest.Body {
112112 }
113113
114114 @inlinable
115- static func stream< SequenceOfBytes: AsyncSequence > (
115+ public static func stream< SequenceOfBytes: AsyncSequence > (
116116 _ sequenceOfBytes: SequenceOfBytes ,
117117 length: Length
118118 ) -> Self where SequenceOfBytes. Element == ByteBuffer {
@@ -124,7 +124,7 @@ extension HTTPClientRequest.Body {
124124 }
125125
126126 @inlinable
127- static func stream< Bytes: AsyncSequence > (
127+ public static func stream< Bytes: AsyncSequence > (
128128 _ bytes: Bytes ,
129129 length: Length
130130 ) -> Self where Bytes. Element == UInt8 {
@@ -157,11 +157,11 @@ extension Optional where Wrapped == HTTPClientRequest.Body {
157157
158158@available ( macOS 10 . 15 , iOS 13 . 0 , watchOS 6 . 0 , tvOS 13 . 0 , * )
159159extension HTTPClientRequest . Body {
160- struct Length {
160+ public struct Length {
161161 /// size of the request body is not known before starting the request
162- static let unknown : Self = . init( storage: . unknown)
162+ public static let unknown : Self = . init( storage: . unknown)
163163 /// size of the request body is fixed and exactly `count` bytes
164- static func known( _ count: Int ) -> Self {
164+ public static func known( _ count: Int ) -> Self {
165165 . init( storage: . known( count) )
166166 }
167167
0 commit comments