@@ -237,7 +237,7 @@ public class HTTPClient {
237237 /// - deadline: Point in time by which the request must complete.
238238 /// - logger: The logger to use for this request.
239239 public func get( url: String , deadline: NIODeadline ? = nil , logger: Logger ) -> EventLoopFuture < Response > {
240- return self . execute ( url : url , method : . GET , deadline: deadline, logger: logger)
240+ return self . execute ( . GET , url : url , deadline: deadline, logger: logger)
241241 }
242242
243243 /// Execute `POST` request using specified URL.
@@ -258,7 +258,7 @@ public class HTTPClient {
258258 /// - deadline: Point in time by which the request must complete.
259259 /// - logger: The logger to use for this request.
260260 public func post( url: String , body: Body ? = nil , deadline: NIODeadline ? = nil , logger: Logger ) -> EventLoopFuture < Response > {
261- return self . execute ( url : url , method : . POST , body: body, deadline: deadline, logger: logger)
261+ return self . execute ( . POST , url : url , body: body, deadline: deadline, logger: logger)
262262 }
263263
264264 /// Execute `PATCH` request using specified URL.
@@ -279,7 +279,7 @@ public class HTTPClient {
279279 /// - deadline: Point in time by which the request must complete.
280280 /// - logger: The logger to use for this request.
281281 public func patch( url: String , body: Body ? = nil , deadline: NIODeadline ? = nil , logger: Logger ) -> EventLoopFuture < Response > {
282- return self . execute ( url : url , method : . PATCH , body: body, deadline: deadline, logger: logger)
282+ return self . execute ( . PATCH , url : url , body: body, deadline: deadline, logger: logger)
283283 }
284284
285285 /// Execute `PUT` request using specified URL.
@@ -300,7 +300,7 @@ public class HTTPClient {
300300 /// - deadline: Point in time by which the request must complete.
301301 /// - logger: The logger to use for this request.
302302 public func put( url: String , body: Body ? = nil , deadline: NIODeadline ? = nil , logger: Logger ) -> EventLoopFuture < Response > {
303- return self . execute ( url : url , method : . PUT , body: body, deadline: deadline, logger: logger)
303+ return self . execute ( . PUT , url : url , body: body, deadline: deadline, logger: logger)
304304 }
305305
306306 /// Execute `DELETE` request using specified URL.
@@ -319,18 +319,18 @@ public class HTTPClient {
319319 /// - deadline: The time when the request must have been completed by.
320320 /// - logger: The logger to use for this request.
321321 public func delete( url: String , deadline: NIODeadline ? = nil , logger: Logger ) -> EventLoopFuture < Response > {
322- return self . execute ( url : url , method : . DELETE , deadline: deadline, logger: logger)
322+ return self . execute ( . DELETE , url : url , deadline: deadline, logger: logger)
323323 }
324324
325325 /// Execute arbitrary HTTP request using specified URL.
326326 ///
327327 /// - parameters:
328- /// - url: Request url.
329328 /// - method: Request method.
329+ /// - url: Request url.
330330 /// - body: Request body.
331331 /// - deadline: Point in time by which the request must complete.
332332 /// - logger: The logger to use for this request.
333- public func execute( url : String , method : HTTPMethod , body: Body ? = nil , deadline: NIODeadline ? = nil , logger: Logger ? = nil ) -> EventLoopFuture < Response > {
333+ public func execute( _ method : HTTPMethod = . GET , url : String , body: Body ? = nil , deadline: NIODeadline ? = nil , logger: Logger ? = nil ) -> EventLoopFuture < Response > {
334334 do {
335335 let request = try Request ( url: url, method: method, body: body)
336336 return self . execute ( request: request, deadline: deadline, logger: logger ?? HTTPClient . loggingDisabled)
@@ -342,15 +342,15 @@ public class HTTPClient {
342342 /// Execute arbitrary HTTP+UNIX request to a unix domain socket path, using the specified URL as the request to send to the server.
343343 ///
344344 /// - parameters:
345- /// - socketPath: The path to the unix domain socket to connect to.
346- /// - url: The URL path and query that will be sent to the server.
347345 /// - method: Request method.
346+ /// - socketPath: The path to the unix domain socket to connect to.
347+ /// - urlPath: The URL path and query that will be sent to the server.
348348 /// - body: Request body.
349349 /// - deadline: Point in time by which the request must complete.
350350 /// - logger: The logger to use for this request.
351- public func execute( socketPath : String , url : String , method : HTTPMethod , body: Body ? = nil , deadline: NIODeadline ? = nil , logger: Logger ? = nil ) -> EventLoopFuture < Response > {
351+ public func execute( _ method : HTTPMethod = . GET , socketPath : String , urlPath : String , body: Body ? = nil , deadline: NIODeadline ? = nil , logger: Logger ? = nil ) -> EventLoopFuture < Response > {
352352 do {
353- guard let url = URL ( httpURLWithSocketPath: socketPath, uri: url ) else {
353+ guard let url = URL ( httpURLWithSocketPath: socketPath, uri: urlPath ) else {
354354 throw HTTPClientError . invalidURL
355355 }
356356 let request = try Request ( url: url, method: method, body: body)
@@ -363,15 +363,15 @@ public class HTTPClient {
363363 /// 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.
364364 ///
365365 /// - parameters:
366- /// - secureSocketPath: The path to the unix domain socket to connect to.
367- /// - url: The URL path and query that will be sent to the server.
368366 /// - method: Request method.
367+ /// - secureSocketPath: The path to the unix domain socket to connect to.
368+ /// - urlPath: The URL path and query that will be sent to the server.
369369 /// - body: Request body.
370370 /// - deadline: Point in time by which the request must complete.
371371 /// - logger: The logger to use for this request.
372- public func execute( secureSocketPath : String , url : String , method : HTTPMethod , body: Body ? = nil , deadline: NIODeadline ? = nil , logger: Logger ? = nil ) -> EventLoopFuture < Response > {
372+ public func execute( _ method : HTTPMethod = . GET , secureSocketPath : String , urlPath : String , body: Body ? = nil , deadline: NIODeadline ? = nil , logger: Logger ? = nil ) -> EventLoopFuture < Response > {
373373 do {
374- guard let url = URL ( httpsURLWithSocketPath: secureSocketPath, uri: url ) else {
374+ guard let url = URL ( httpsURLWithSocketPath: secureSocketPath, uri: urlPath ) else {
375375 throw HTTPClientError . invalidURL
376376 }
377377 let request = try Request ( url: url, method: method, body: body)
0 commit comments