ghostrider ghostrider - 5 months ago 41
JSON Question

Unsupported URL in NSURLRequest

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

curl -XGET

My code for the NSURlRequest is this:

NSURLRequest *request = [NSURLRequest requestWithURL:
[NSURL URLWithString:@""]];

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

And I am getting this error:

2013-11-29 22:31:08.164 Ski Greece[607:a0b] Connection failed: Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo=0xcd042d0 {NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, 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 to include appropriate url scheme to your url, e.g.

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