If I run this request from my terminal I can see the JSON requests as normally:

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

My code for the NSURlRequest is this:

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

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

And I am getting this error:

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"}

How can I make the call to that URL? I cannot access the server code - I know it is just setup to return me what I need, if I call that URL?

推荐答案

try 在你的url中加入合适的url方案,例如.

[NSURL URLWithString:@"http://www...

Json相关问答推荐

SSIS Kingswaysoft Json源动态 node 名称

Jolt转换,如果任何字段为空,则将对象值设置为空

JQ如何获取特定子元素的所有父母

在Ruby的json中压缩单个字段

使用 jq 将非统一的 json 输出转换为汇总表

如何在 Apps 脚本中循环遍历 JSON 响应

如何将复杂的 JSON 反序列化为 Rust 类型?

无法使用 vue.js 访问 JSON 数组的项目

使用 REACT 从字段值中读取 JSON 元素

如何在 wso2 中组合 2 个 json 有效负载?

Powershell 无法从名为 count 的键中获取价值

如何判断 Json 对象中是否存在键并获取其值

Laravel5 Json 获取文件内容

在 Http Header 中使用 Json 字符串

如何在 swift 2 中获取 Alamofire.request().responseJSON 的结果值?

使用 Python 3 读取 JSON 文件

我可以使用空字符串作为对象标识符吗?

Microsoft.Net.Http 与 Microsoft.AspNet.WebApi.Client

来自 Gson 的 JSON 字符串:删除双引号

如何使用 SwiftyJSON 遍历 JSON?