URLComponents.url is nil
It looks like path parameter’s string must start with /. So change “auth/login” to “/auth/login” will do.
It looks like path parameter’s string must start with /. So change “auth/login” to “/auth/login” will do.
It makes only a difference if you create the URL components from an NSURL which was created relative to another NSURL: let baseURL = NSURL(string: “http://server/foo/”)! let url = NSURL(string: “bar/file.html”, relativeToURL: baseURL)! print(url.absoluteString) // “http://server/foo/bar/file.html” With resolvingAgainstBaseURL == false, the URL components represent only the relative part of the URL: let comp1 = NSURLComponents(URL: … Read more