Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unsupported URL in NSURLRequest

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?

like image 455
ghostrider Avatar asked Nov 29 '13 22:11

ghostrider


People also ask

What do I do with an unsupported URL?

Unsupported URL" You would receive this error if you are having issues with your data or internet connection, especially with certain WiFi connections. We would advise turning Airplane mode on, then off, to help reset your connection.

What does unsupported URL mean in tap browser?

Error: "Login Error Unsupported URL" This error can occur if Open Access has been configured with SSL but binding configurations have not been set up within the web. config file. The values for bindingConfiguration and "binding name" are case sensitive and must match.


2 Answers

Try to include appropriate url scheme to your url, e.g.

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

like image 135
Vizllx Avatar answered Sep 20 '22 09:09

Vizllx


In my case I fixed it with this :

strURL = [strURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 

strURL contains the string with the URL.

like image 41
Alf G Avatar answered Sep 20 '22 09:09

Alf G