我正在使用Xcode 9.4.1版模拟器,出现此错误:
<1> HTTP load failed (error code: -1003 [12:8])
2018-08-15 05:14:42.275912+0000 FoodTaskerMobile[10864:360131] Task <04D22041-2589-440F-AB57-2E4C2FFFF4CF>.<1> finished with error - code: -1003
// API to login an user
func login(userType: String, completionHandler: @escaping (NSError?) -> Void) {
let path = "api/social/convert-token/"
let url = baseURL!.appendingPathComponent(path)
let params: [String: Any] = [
"grant_type": "convert_token",
"client_id": CLIENT_ID,
"client_secret": CLIENT_SECRET,
"backend": "facebook",
"token": FBSDKAccessToken.current().tokenString,
"user_type": userType
]
和
import Foundation
let BASE_URL: String = "http://loaclhost:8000"
let CLIENT_ID: String = "gvJawJBuORje858lQS4HBzTBHC84vUuzzw5vzjNi"
let CLIENT_SECRET: String = "vkqJhkDbc3UOsxpxrlaXMwuReGVrWs9T55TmDixpFTGBTlY0MAtS9WsggM5Zaojnjw8LnfxB5k7fhKUfakhmsEmQgyKKZMsnckcUY4quCCsU3PH0qwRZoraQNjiE30Nf"
我已经尝试过这种方法,但仍然没有解决。