@@ -194,7 +194,7 @@ public class HTTPClient {
194194 /// - url: Remote URL.
195195 /// - deadline: Point in time by which the request must complete.
196196 public func get( url: String , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
197- return self . execute ( url : url , method : . GET , deadline: deadline)
197+ return self . execute ( . GET , url : url , deadline: deadline)
198198 }
199199
200200 /// Execute `POST` request using specified URL.
@@ -204,7 +204,7 @@ public class HTTPClient {
204204 /// - body: Request body.
205205 /// - deadline: Point in time by which the request must complete.
206206 public func post( url: String , body: Body ? = nil , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
207- return self . execute ( url : url , method : . POST , body: body, deadline: deadline)
207+ return self . execute ( . POST , url : url , body: body, deadline: deadline)
208208 }
209209
210210 /// Execute `PATCH` request using specified URL.
@@ -214,7 +214,7 @@ public class HTTPClient {
214214 /// - body: Request body.
215215 /// - deadline: Point in time by which the request must complete.
216216 public func patch( url: String , body: Body ? = nil , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
217- return self . execute ( url : url , method : . PATCH , body: body, deadline: deadline)
217+ return self . execute ( . PATCH , url : url , body: body, deadline: deadline)
218218 }
219219
220220 /// Execute `PUT` request using specified URL.
@@ -224,7 +224,7 @@ public class HTTPClient {
224224 /// - body: Request body.
225225 /// - deadline: Point in time by which the request must complete.
226226 public func put( url: String , body: Body ? = nil , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
227- return self . execute ( url : url , method : . PUT , body: body, deadline: deadline)
227+ return self . execute ( . PUT , url : url , body: body, deadline: deadline)
228228 }
229229
230230 /// Execute `DELETE` request using specified URL.
@@ -233,17 +233,17 @@ public class HTTPClient {
233233 /// - url: Remote URL.
234234 /// - deadline: The time when the request must have been completed by.
235235 public func delete( url: String , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
236- return self . execute ( url : url , method : . DELETE , deadline: deadline)
236+ return self . execute ( . DELETE , url : url , deadline: deadline)
237237 }
238238
239239 /// Execute arbitrary HTTP request using specified URL.
240240 ///
241241 /// - parameters:
242- /// - url: Request url.
243242 /// - method: Request method.
243+ /// - url: Request url.
244244 /// - body: Request body.
245245 /// - deadline: Point in time by which the request must complete.
246- public func execute( url : String , method : HTTPMethod , body: Body ? = nil , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
246+ public func execute( _ method : HTTPMethod = . GET , url : String , body: Body ? = nil , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
247247 do {
248248 let request = try Request ( url: url, method: method, body: body)
249249 return self . execute ( request: request, deadline: deadline)
@@ -255,14 +255,14 @@ public class HTTPClient {
255255 /// Execute arbitrary HTTP+UNIX request to a unix domain socket path, using the specified URL as the request to send to the server.
256256 ///
257257 /// - parameters:
258- /// - socketPath: The path to the unix domain socket to connect to.
259- /// - url: The URL path and query that will be sent to the server.
260258 /// - method: Request method.
259+ /// - socketPath: The path to the unix domain socket to connect to.
260+ /// - urlPath: The URL path and query that will be sent to the server.
261261 /// - body: Request body.
262262 /// - deadline: Point in time by which the request must complete.
263- public func execute( socketPath : String , url : String , method : HTTPMethod , body: Body ? = nil , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
263+ public func execute( _ method : HTTPMethod = . GET , socketPath : String , urlPath : String , body: Body ? = nil , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
264264 do {
265- guard let url = URL ( httpURLWithSocketPath: socketPath, uri: url ) else {
265+ guard let url = URL ( httpURLWithSocketPath: socketPath, uri: urlPath ) else {
266266 throw HTTPClientError . invalidURL
267267 }
268268 let request = try Request ( url: url, method: method, body: body)
@@ -275,14 +275,14 @@ public class HTTPClient {
275275 /// Execute arbitrary HTTPS+UNIX request to a unix domain socket path over TLS, using the specified URL as the request to send to the server.
276276 ///
277277 /// - parameters:
278- /// - secureSocketPath: The path to the unix domain socket to connect to.
279- /// - url: The URL path and query that will be sent to the server.
280278 /// - method: Request method.
279+ /// - secureSocketPath: The path to the unix domain socket to connect to.
280+ /// - urlPath: The URL path and query that will be sent to the server.
281281 /// - body: Request body.
282282 /// - deadline: Point in time by which the request must complete.
283- public func execute( secureSocketPath : String , url : String , method : HTTPMethod , body: Body ? = nil , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
283+ public func execute( _ method : HTTPMethod = . GET , secureSocketPath : String , urlPath : String , body: Body ? = nil , deadline: NIODeadline ? = nil ) -> EventLoopFuture < Response > {
284284 do {
285- guard let url = URL ( httpsURLWithSocketPath: secureSocketPath, uri: url ) else {
285+ guard let url = URL ( httpsURLWithSocketPath: secureSocketPath, uri: urlPath ) else {
286286 throw HTTPClientError . invalidURL
287287 }
288288 let request = try Request ( url: url, method: method, body: body)
0 commit comments