我有一个我正在尝试连接的API,服务器是Windows身份验证。我正在尝试通过委托(delegate)方法将URLSession与URLCredential结合使用funcurlSession(_session:URLSession,didReceivechallenge:URLAuthenticationChallenge,completionHandler:@escaping(URLSession.AuthChallengeDisposition,URLCredential?)->Swift.Void){vardisposition:URLSession.AuthChallenge
我有一个我正在尝试连接的API,服务器是Windows身份验证。我正在尝试通过委托(delegate)方法将URLSession与URLCredential结合使用funcurlSession(_session:URLSession,didReceivechallenge:URLAuthenticationChallenge,completionHandler:@escaping(URLSession.AuthChallengeDisposition,URLCredential?)->Swift.Void){vardisposition:URLSession.AuthChallenge
我正在执行URLSession,但URL需要凭据。我这里有整个方法试图用URLCredentials做一个URLSession:funcloginUser(_username:String,password:String,completion:@escaping(_result:Bool)->Void){//CreaterequestURLasStringletrequestString=String(format:"%@",webservice)asString//CovertURLrequeststringtoURLguardleturl=URL(string:requestStr