使用ASIHTTPRequest时发现错误
我正在尝试使用 ASIHTTP 请求。但当我运行我的代码时,我收到以下错误消息。
我的代码有任何问题请帮助我并谢谢
Domain=ASIHTTPRequestErrorDomain Code=6“无法获取信息 在请求所需的代理服务器上”UserInfo=0x6043490 {NSLocalizedDescription=无法获取代理服务器信息 需要请求}
下面是我的源代码
- (void)viewDidLoad {
NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startSynchronous];
[super viewDidLoad];
}
- (void)requestFailed:(ASIHTTPRequest *)request
{
NSLog(@"Error %@", [request error]);
if ([request error])
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Fail."
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
return;
}
}
I am trying to use the ASIHTTPrequest. but i get the below error message when i run my code.
Anything wrong in my code please help me up and thanks
Domain=ASIHTTPRequestErrorDomain Code=6 "Unable to obtain information
on proxy servers needed for request" UserInfo=0x6043490
{NSLocalizedDescription=Unable to obtain information on proxy servers
needed for request}
Below is my source code
- (void)viewDidLoad {
NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startSynchronous];
[super viewDidLoad];
}
- (void)requestFailed:(ASIHTTPRequest *)request
{
NSLog(@"Error %@", [request error]);
if ([request error])
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Fail."
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
return;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谷歌搜索错误消息在 ASIHTTPRequest 邮件列表中显示了几个结果:
http://groups.google.com/group/asihttprequest/browse_thread/thread/924540472d721696/0dd6d853005631b0
http://groups.google.com/group/asihttprequest/browse_thread/thread/c15bcb756773685a
简而言之,该错误很可能与获取代理自动配置的问题有关文件。
因此:
Googling for the error message turns up several results in the ASIHTTPRequest mailing list:
http://groups.google.com/group/asihttprequest/browse_thread/thread/924540472d721696/0dd6d853005631b0
http://groups.google.com/group/asihttprequest/browse_thread/thread/c15bcb756773685a
In short, it seems like there's a good chance the error is related to a problem fetching the proxy autoconfiguration file.
So: