Open Gargo opened 5 years ago
You can do that for the other functions
‘’’ var parameters: RequestParams { return .url(nil) }
var headers: [String : Any]? {
return nil
}
‘’’
See if it works for you
@emadhegab I solved it by the following code:
extension Request {
var path: String {
return ""
}
var method: HTTPMethod {
return .get
}
var parameters: RequestParams {
return .url(nil)
}
var headers: [String : Any]? {
return nil
}
}
enum RTDefaultRequest: Request {
case `default`
}
extension Operations {
var request: Request {
return RTDefaultRequest.default
}
}
It adds default implementations for these methods and simplifies the development for some cases.
For example I need a library to collect rss from different websites. I need to specify single url only and get/post method only for each website. You library requires to setup all params even if they are not necessary