Objective c 如何删除ASIHTTPRequest中http摘要身份验证使用的凭据

Objective c 如何删除ASIHTTPRequest中http摘要身份验证使用的凭据,objective-c,asihttprequest,Objective C,Asihttprequest,我尝试调用[ASIHTTPRequest clearSession],但是请求仍然可以返回200状态,即使使用了错误的用户名和密码 我该怎么办 ASIHTTPRequest对象将用户信息存储在“会话”中默认情况下,您必须在创建的每个请求上禁用该功能,以获得所需的行为 从网站文档: NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com/top_secret/"]; ASIHTTPRequest *request = [ASIHTTPR

我尝试调用
[ASIHTTPRequest clearSession]
,但是请求仍然可以返回200状态,即使使用了错误的用户名和密码


我该怎么办

ASIHTTPRequest对象将用户信息存储在“会话”中默认情况下,您必须在创建的每个请求上禁用该功能,以获得所需的行为

从网站文档:

NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com/top_secret/"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setUsername:@"username"];
[request setPassword:@"password"];
[request setUseSessionPersistence:NO]; //this is the line that disables storage

更多信息。

这还不够,还必须为请求禁用cookie存储。[请求setUseCookiePersistence:否];