@@ -117,36 +117,36 @@ public final class Client: Service {
117
117
118
118
public struct Builder : RequestBuilder {
119
119
public var client : Client
120
- public var urlComponents : URLComponents { get { request . urlComponents } set { request . urlComponents = newValue} }
121
- public var method : HTTPMethod { get { request . method } set { request . method = newValue} }
122
- public var headers : HTTPHeaders { get { request . headers } set { request . headers = newValue} }
123
- public var body : ByteContent ? { get { request . body } set { request . body = newValue} }
124
- private var request : Client . Request
125
-
120
+ public var urlComponents : URLComponents { get { clientRequest . urlComponents } set { clientRequest . urlComponents = newValue} }
121
+ public var method : HTTPMethod { get { clientRequest . method } set { clientRequest . method = newValue} }
122
+ public var headers : HTTPHeaders { get { clientRequest . headers } set { clientRequest . headers = newValue} }
123
+ public var body : ByteContent ? { get { clientRequest . body } set { clientRequest . body = newValue} }
124
+ public private( set ) var clientRequest : Client . Request
125
+
126
126
init ( client: Client ) {
127
127
self . client = client
128
- self . request = Request ( )
128
+ self . clientRequest = Request ( )
129
129
}
130
130
131
131
public func execute( ) async throws -> Client . Response {
132
- try await client. execute ( req: request )
132
+ try await client. execute ( req: clientRequest )
133
133
}
134
134
135
135
/// Sets an `HTTPClient.Configuration` for this request only. See the
136
136
/// `swift-server/async-http-client` package for configuration
137
137
/// options.
138
138
public func withClientConfig( _ config: HTTPClient . Configuration ) -> Builder {
139
- with { $0. request . config = config }
139
+ with { $0. clientRequest . config = config }
140
140
}
141
141
142
142
/// Timeout if the request doesn't finish in the given time amount.
143
143
public func withTimeout( _ timeout: TimeAmount ) -> Builder {
144
- with { $0. request . timeout = timeout }
144
+ with { $0. clientRequest . timeout = timeout }
145
145
}
146
146
147
147
/// Allow the response to be streamed.
148
148
public func withStream( ) -> Builder {
149
- with { $0. request . streamResponse = true }
149
+ with { $0. clientRequest . streamResponse = true }
150
150
}
151
151
152
152
/// Stub this builder's client, causing it to respond to all incoming
0 commit comments