@@ -39,15 +39,15 @@ public class FernoAPIRequest: FernoRequest {
39
39
40
40
public func delete( req: Request , method: HTTPMethod , path: [ String ] ) throws -> Future < Bool > {
41
41
return try self . createRequest ( method: method, path: path, query: [ ] , body: " " , headers: [ : ] ) . flatMap ( { request in
42
- return try self . httpClient. respond ( to : request) . map ( { response in
42
+ return self . httpClient. send ( request) . map ( { response in
43
43
return response. http. status == . ok
44
44
} )
45
45
} )
46
46
}
47
47
48
48
public func send< F: Decodable , T: Content > ( req: Request , method: HTTPMethod , path: [ String ] , query: [ FernoQuery ] , body: T , headers: HTTPHeaders ) throws -> Future < F > {
49
49
return try self . createRequest ( method: method, path: path, query: query, body: body, headers: headers) . flatMap ( { ( request) in
50
- return try self . httpClient. respond ( to : request) . flatMap ( to: F . self) { response in
50
+ return self . httpClient. send ( request) . flatMap ( to: F . self) { response in
51
51
guard response. http. status == . ok else { throw FernoError . requestFailed }
52
52
return try self . decoder. decode ( F . self, from: response. http, maxSize: 65_536 , on: req)
53
53
}
@@ -56,7 +56,7 @@ public class FernoAPIRequest: FernoRequest {
56
56
57
57
public func sendMany< F: Decodable , T: Content > ( req: Request , method: HTTPMethod , path: [ String ] , query: [ FernoQuery ] , body: T , headers: HTTPHeaders ) throws -> Future < [ String : F ] > {
58
58
return try self . createRequest ( method: method, path: path, query: query, body: body, headers: headers) . flatMap ( { ( request) in
59
- return try self . httpClient. respond ( to : request) . flatMap ( to: [ String : F ] . self) { response in
59
+ return self . httpClient. send ( request) . flatMap ( to: [ String : F ] . self) { response in
60
60
guard response. http. status == . ok else { throw FernoError . requestFailed }
61
61
return try self . decoder. decode ( Snapshot< F> . self , from: response. http, maxSize: 65_536 , on: req) . map { snapshot in
62
62
return snapshot. data
@@ -109,7 +109,7 @@ extension FernoAPIRequest {
109
109
try req. content. encode ( oauthBody, as: . urlEncodedForm)
110
110
req. http. url = URL ( string: " https://www.googleapis.com/oauth2/v4/token " ) !
111
111
req. http. method = . POST
112
- return try self . httpClient. respond ( to : req) . flatMap ( to: OAuthResponse . self) { result in
112
+ return self . httpClient. send ( req) . flatMap ( to: OAuthResponse . self) { result in
113
113
let oauthRes : Future < OAuthResponse > = try result. content. decode ( OAuthResponse . self)
114
114
return oauthRes
115
115
} . map ( to: String . self) { resp in
0 commit comments