Group Group Group Group Group Group Group Group Group

Chapter 12 - NSURLComponents

#1

Hi,

in your book you use
let urlComponents = NSURLComponents(url: url, resolvingAgainstBaseURL: true)!
in the method private func buildRequest(method: String = "GET", pathComponent: String, params: [(String, String)]) -> Observable<Data> Is there a reason for not using URLComponents, because with your approach the request doesn’t seem to live long enough to return data. - I always got the same error which I did not get with URLComponents … BTW my network connection is Stable :]

Unhandled error happened: Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.” UserInfo={NSUnderlyingError=0x600002de2010 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 “(null)” UserInfo={_kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://api.openweathermap.org/data/2.5/weather?q=RxSwift&appid=XXXXXXMYKEYXXXXXX&units=metric, NSErrorFailingURLKey=http://api.openweathermap.org/data/2.5/weather?q=RxSwift&appid=XXXXXXMYKEYXXXXXX&units=metric, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=57, NSLocalizedDescription=The network connection was lost.}

#2

@mook94 Do you still have issues with this?