Alamofire's callback block cannot run, i'm sure the server received the request send by Alamofire here‘s the code:
import Alamofire
import Foundation
@main
public struct SwiftClient {
public static func main() {
let url = "http://127.0.0.1:8080/hello"
AF.request(url).response { response in
debugPrint(response)
}
sleep(10)
}
}
when i execute swift run
, debugPrint doesn't run