mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
Swift3 headers (#5340)
* added headers to makeRequest function for swift3 template * petstore update
This commit is contained in:
parent
19d5e74dbd
commit
c6959b0d21
@ -45,8 +45,8 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
May be overridden by a subclass if you want to control the request
|
||||
configuration (e.g. to override the cache policy).
|
||||
*/
|
||||
open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding) -> DataRequest {
|
||||
return manager.request(URLString, method: method, parameters: parameters, encoding: encoding)
|
||||
open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest {
|
||||
return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers)
|
||||
}
|
||||
|
||||
override open func execute(_ completion: @escaping (_ response: Response<T>?, _ error: Error?) -> Void) {
|
||||
@ -96,7 +96,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding)
|
||||
let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers)
|
||||
if let onProgressReady = self.onProgressReady {
|
||||
onProgressReady(request.progress)
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
May be overridden by a subclass if you want to control the request
|
||||
configuration (e.g. to override the cache policy).
|
||||
*/
|
||||
open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding) -> DataRequest {
|
||||
return manager.request(URLString, method: method, parameters: parameters, encoding: encoding)
|
||||
open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest {
|
||||
return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers)
|
||||
}
|
||||
|
||||
override open func execute(_ completion: @escaping (_ response: Response<T>?, _ error: Error?) -> Void) {
|
||||
@ -96,7 +96,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding)
|
||||
let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers)
|
||||
if let onProgressReady = self.onProgressReady {
|
||||
onProgressReady(request.progress)
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
May be overridden by a subclass if you want to control the request
|
||||
configuration (e.g. to override the cache policy).
|
||||
*/
|
||||
open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding) -> DataRequest {
|
||||
return manager.request(URLString, method: method, parameters: parameters, encoding: encoding)
|
||||
open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest {
|
||||
return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers)
|
||||
}
|
||||
|
||||
override open func execute(_ completion: @escaping (_ response: Response<T>?, _ error: Error?) -> Void) {
|
||||
@ -96,7 +96,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding)
|
||||
let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers)
|
||||
if let onProgressReady = self.onProgressReady {
|
||||
onProgressReady(request.progress)
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
May be overridden by a subclass if you want to control the request
|
||||
configuration (e.g. to override the cache policy).
|
||||
*/
|
||||
open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding) -> DataRequest {
|
||||
return manager.request(URLString, method: method, parameters: parameters, encoding: encoding)
|
||||
open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest {
|
||||
return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers)
|
||||
}
|
||||
|
||||
override open func execute(_ completion: @escaping (_ response: Response<T>?, _ error: Error?) -> Void) {
|
||||
@ -96,7 +96,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding)
|
||||
let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers)
|
||||
if let onProgressReady = self.onProgressReady {
|
||||
onProgressReady(request.progress)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user