@@ -17,14 +17,14 @@ import NIOCore
17
17
import NIOHTTP1
18
18
19
19
@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
24
24
25
- var body : Body ?
25
+ public var body : Body ?
26
26
27
- init ( url: String ) {
27
+ public init ( url: String ) {
28
28
self . url = url
29
29
self . method = . GET
30
30
self . headers = . init( )
@@ -34,7 +34,7 @@ struct HTTPClientRequest {
34
34
35
35
@available ( macOS 10 . 15 , iOS 13 . 0 , watchOS 6 . 0 , tvOS 13 . 0 , * )
36
36
extension HTTPClientRequest {
37
- struct Body {
37
+ public struct Body {
38
38
@usableFromInline
39
39
internal enum Mode {
40
40
case asyncSequence( length: RequestBodyLength , ( ByteBufferAllocator ) async throws -> ByteBuffer ? )
@@ -54,12 +54,12 @@ extension HTTPClientRequest {
54
54
55
55
@available ( macOS 10 . 15 , iOS 13 . 0 , watchOS 6 . 0 , tvOS 13 . 0 , * )
56
56
extension HTTPClientRequest . Body {
57
- static func bytes( _ byteBuffer: ByteBuffer ) -> Self {
57
+ public static func bytes( _ byteBuffer: ByteBuffer ) -> Self {
58
58
self . init ( . byteBuffer( byteBuffer) )
59
59
}
60
60
61
61
@inlinable
62
- static func bytes< Bytes: RandomAccessCollection > (
62
+ public static func bytes< Bytes: RandomAccessCollection > (
63
63
_ bytes: Bytes
64
64
) -> Self where Bytes. Element == UInt8 {
65
65
self . init ( . sequence(
@@ -76,7 +76,7 @@ extension HTTPClientRequest.Body {
76
76
}
77
77
78
78
@inlinable
79
- static func bytes< Bytes: Sequence > (
79
+ public static func bytes< Bytes: Sequence > (
80
80
_ bytes: Bytes ,
81
81
length: Length
82
82
) -> Self where Bytes. Element == UInt8 {
@@ -94,7 +94,7 @@ extension HTTPClientRequest.Body {
94
94
}
95
95
96
96
@inlinable
97
- static func bytes< Bytes: Collection > (
97
+ public static func bytes< Bytes: Collection > (
98
98
_ bytes: Bytes ,
99
99
length: Length
100
100
) -> Self where Bytes. Element == UInt8 {
@@ -112,7 +112,7 @@ extension HTTPClientRequest.Body {
112
112
}
113
113
114
114
@inlinable
115
- static func stream< SequenceOfBytes: AsyncSequence > (
115
+ public static func stream< SequenceOfBytes: AsyncSequence > (
116
116
_ sequenceOfBytes: SequenceOfBytes ,
117
117
length: Length
118
118
) -> Self where SequenceOfBytes. Element == ByteBuffer {
@@ -124,7 +124,7 @@ extension HTTPClientRequest.Body {
124
124
}
125
125
126
126
@inlinable
127
- static func stream< Bytes: AsyncSequence > (
127
+ public static func stream< Bytes: AsyncSequence > (
128
128
_ bytes: Bytes ,
129
129
length: Length
130
130
) -> Self where Bytes. Element == UInt8 {
@@ -157,11 +157,11 @@ extension Optional where Wrapped == HTTPClientRequest.Body {
157
157
158
158
@available ( macOS 10 . 15 , iOS 13 . 0 , watchOS 6 . 0 , tvOS 13 . 0 , * )
159
159
extension HTTPClientRequest . Body {
160
- struct Length {
160
+ public struct Length {
161
161
/// 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)
163
163
/// 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 {
165
165
. init( storage: . known( count) )
166
166
}
167
167
0 commit comments