@@ -237,7 +237,7 @@ public class HTTPClient {
237
237
/// - deadline: Point in time by which the request must complete.
238
238
/// - logger: The logger to use for this request.
239
239
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)
241
241
}
242
242
243
243
/// Execute `POST` request using specified URL.
@@ -258,7 +258,7 @@ public class HTTPClient {
258
258
/// - deadline: Point in time by which the request must complete.
259
259
/// - logger: The logger to use for this request.
260
260
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)
262
262
}
263
263
264
264
/// Execute `PATCH` request using specified URL.
@@ -279,7 +279,7 @@ public class HTTPClient {
279
279
/// - deadline: Point in time by which the request must complete.
280
280
/// - logger: The logger to use for this request.
281
281
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)
283
283
}
284
284
285
285
/// Execute `PUT` request using specified URL.
@@ -300,7 +300,7 @@ public class HTTPClient {
300
300
/// - deadline: Point in time by which the request must complete.
301
301
/// - logger: The logger to use for this request.
302
302
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)
304
304
}
305
305
306
306
/// Execute `DELETE` request using specified URL.
@@ -319,18 +319,18 @@ public class HTTPClient {
319
319
/// - deadline: The time when the request must have been completed by.
320
320
/// - logger: The logger to use for this request.
321
321
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)
323
323
}
324
324
325
325
/// Execute arbitrary HTTP request using specified URL.
326
326
///
327
327
/// - parameters:
328
- /// - url: Request url.
329
328
/// - method: Request method.
329
+ /// - url: Request url.
330
330
/// - body: Request body.
331
331
/// - deadline: Point in time by which the request must complete.
332
332
/// - 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 > {
334
334
do {
335
335
let request = try Request ( url: url, method: method, body: body)
336
336
return self . execute ( request: request, deadline: deadline, logger: logger ?? HTTPClient . loggingDisabled)
@@ -342,15 +342,15 @@ public class HTTPClient {
342
342
/// Execute arbitrary HTTP+UNIX request to a unix domain socket path, using the specified URL as the request to send to the server.
343
343
///
344
344
/// - 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.
347
345
/// - 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.
348
348
/// - body: Request body.
349
349
/// - deadline: Point in time by which the request must complete.
350
350
/// - 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 > {
352
352
do {
353
- guard let url = URL ( httpURLWithSocketPath: socketPath, uri: url ) else {
353
+ guard let url = URL ( httpURLWithSocketPath: socketPath, uri: urlPath ) else {
354
354
throw HTTPClientError . invalidURL
355
355
}
356
356
let request = try Request ( url: url, method: method, body: body)
@@ -363,15 +363,15 @@ public class HTTPClient {
363
363
/// 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.
364
364
///
365
365
/// - 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.
368
366
/// - 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.
369
369
/// - body: Request body.
370
370
/// - deadline: Point in time by which the request must complete.
371
371
/// - 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 > {
373
373
do {
374
- guard let url = URL ( httpsURLWithSocketPath: secureSocketPath, uri: url ) else {
374
+ guard let url = URL ( httpsURLWithSocketPath: secureSocketPath, uri: urlPath ) else {
375
375
throw HTTPClientError . invalidURL
376
376
}
377
377
let request = try Request ( url: url, method: method, body: body)
0 commit comments