2
我試圖執行GET請求,但我得到以下兩個錯誤:斯威夫特2:Alamofire GET發行
使用未解決的標識符 '自我'
和
的預期申報
這是我受影響的代碼
let credentialData = "\(self._username):\(self._password)".dataUsingEncoding(NSUTF8StringEncoding)!
let base64Credentials = credentialData.base64EncodedStringWithOptions([])
let headers = ["Authorization": "Basic \(base64Credentials)"]
Alamofire.request(.GET, "http://gemcave.pythonanywhere.com/api/order\(self._username)/\(self._password)", headers: headers)
.responseJSON { response in
debugPrint(response)
}