請問ASIHTTPRequet支援digest authentication嗎
用代碼如下:
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)
推
10/26 20:19, , 1F
10/26 20:19, 1F
→
10/26 22:32, , 2F
10/26 22:32, 2F
推
10/28 02:22, , 3F
10/28 02:22, 3F
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章