I'm using RxAlamofire
to create my observable
. I have build the URLRequest
. normally with Alamofire
we can use like Alamofire.request(urlRequest)
but seem with RxAlamofire
I can not use RxAlamofire.requet(urlRequest)
Here is my function
func createOrUpdateItem(for id: NSNumber) -> Observable<Item> {
let testRequest = Router.top.urlRequest
let test = RxAlamofire.request(testRequest)
}
Seem like RxAlamofire
only accept parameter which are URL
and URLConvertible
. The strange thing is i look through RxAlamofire there are 2 method which accept both URLConvertible
and URLRequestConvertible
. Anyone has same same issue and how to resolve? I'm asking this because my app use Alamofire Router
which is an enum adopt to URLRequestConvertible
.
/**
Creates an observable of the `Request`.
- parameter method: Alamofire method object
- parameter url: An object adopting `URLConvertible`
- parameter parameters: A dictionary containing all necessary options
- parameter encoding: The kind of encoding used to process parameters
- parameter header: A dictionary containing all the addional headers
- returns: An observable of the `Request`
*/
public func request(_ method: Alamofire.HTTPMethod, _ url: URLConvertible, parameters: [String : Any]? = default, encoding: ParameterEncoding = default, headers: [String : String]? = default) -> RxSwift.Observable<Alamofire.DataRequest>
/**
Creates an observable of the `Request`.
- parameter URLRequest: An object adopting `URLRequestConvertible`
- parameter parameters: A dictionary containing all necessary options
- parameter encoding: The kind of encoding used to process parameters
- parameter header: A dictionary containing all the addional headers
- returns: An observable of the `Request`
*/
public func request(urlRequest: URLRequestConvertible) -> RxSwift.Observable<Alamofire.DataRequest>