看板 MacDev 關於我們 聯絡資訊
用代碼如下: ASIHTTPRequest *requestASI = [[[ASIHTTPRequest alloc] initWithURL:urlFromString] autorelease]; requestASI.shouldPresentCredentialsBeforeChallenge = YES; [requestASI setValidatesSecureCertificate:YES]; [requestASI setUsername:authMD]; [requestASI setPassword:authPassword]; [requestASI setAuthenticationScheme:(NSString *)kCFHTTPAuthenticationSchemeDigest]; [requestASI addRequestHeader:@"Accept" value:@"application/json;charset=UTF-8"]; [requestASI addRequestHeader:@"Accept-Encoding" value:@"gzip,deflate"]; [requestASI setShouldAttemptPersistentConnection:YES]; [requestASI setDelegate:self]; [requestASI setDidFinishSelector:@selector(ResquestFinished:)]; [requestASI setDidFailSelector:@selector(ResquestFailed:)]; [requestASI startAsynchronous]; 可是總是第1次回傳Authentication needed 但連續發送2次就能成功Authentication needed 可不可以設定參數後在第1次就發送成功,有人作過嗎? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.25.148.86 ※ 編輯: fightword 來自: 114.25.148.86 (10/26 17:17)
johnlinvc:ASI已經停止開發了,建議改用AFNetworking||RestKit 10/26 20:19
osnq:聽起來怎麼好像是成功是第一次的response... 10/26 22:32
Boska:AFN好物 10/28 02:22