首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >NSURLRequest中不支持的URL

NSURLRequest中不支持的URL
EN

Stack Overflow用户
提问于 2013-11-30 06:45:38
回答 10查看 60.5K关注 0票数 36

如果我从我的终端运行这个请求,我可以照常看到JSON请求:

curl -XGET 192.168.0.6:8888/scripts/data/backend2/index.php/name/_all

我的NSURlRequest代码是这样的:

 NSURLRequest *request = [NSURLRequest requestWithURL:
                             [NSURL URLWithString:@"192.168.0.6:8888/scripts/data/backend2/index.php/name/_all"]];

    [[NSURLConnection alloc] initWithRequest:request delegate:self];

我得到了这个错误:

didFailWithError
2013-11-29 22:31:08.164 Ski Greece[607:a0b] Connection failed: Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo=0xcd042d0 {NSErrorFailingURLStringKey=192.168.0.6:8888/scripts/data/backend2/index.php/name/_all, NSErrorFailingURLKey=192.168.0.6:8888/scripts/data/backend2/index.php/name/_all, NSLocalizedDescription=unsupported URL, NSUnderlyingError=0xdbdcc70 "unsupported URL"}

如何调用该URL?我无法访问服务器代码-如果我调用该URL,我知道它只是设置为返回我所需的内容?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20294328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档