我正在通过 NSURLRequest 检索数据,它运行良好。我现在已经为该目录添加了密码保护,但我不确定如何配置我的代码以添加目录的密码(myStuff)
谁能告诉我这是如何根据我当前的代码完成的?
谢谢
-(void) retrieve
{
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://XXXXXXX.com/myStuff/test.php"]cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:8.0];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
receivedData = [[NSMutableData data] retain];
} else {
// Inform the user that the connection failed.
[self showServerAlert];
return;
}
}
//CALL THE OTHER DELEGATE METHODS