Note that there are some explanatory texts on larger screens.

plurals
  1. POBad URL when creating NSURL
    primarykey
    data
    text
    <p>I am making request on server , having spaces in URL </p> <p>http://xxxxxxxx.com/api/api.php?func=showAllwedsdwewsdsd&amp;params[]=Saudi%20Arab&amp;params[]=all</p> <p>I was getting the error Bad URL so ,</p> <p>I used </p> <pre><code> downloadURL = [downloadURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; </code></pre> <p>but due this I am getting strange URL as </p> <pre><code> http://sdsdsdsdsdsd.com/api/api.php?func=showAllsdsd&amp;params5262721536=Saudi 0X0P+0rabia&amp;params5 8288=All </code></pre> <p>I am also using </p> <pre><code> downloadURL= [downloadURL stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; </code></pre> <p>but again strange url like </p> <pre><code> http://xxxxxxxxx.com/api/api.php?func=showsdsdsd&amp;params[]=Saudi 0X1.240DC0D824P-807rabia&amp;params[]=All </code></pre> <p>Please help how can I solve this issue</p> <p><strong>Edit</strong> Pasting Big portion of code</p> <pre><code> PropertyXMLDownloader *download=[[PropertyXMLDownloader alloc]init]; [download setDelegate:self]; firstAppDelegate *del=(firstAppDelegate *)[[UIApplication sharedApplication]delegate]; NSLog(@"Country is %@",del.country); NSLog(@"State is %@",del.state); // del.country=[del.country stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; NSString *downloadURL=[NSString stringWithFormat:@"http://xxxxxxxx.com/api/api.php?func=showAll&amp;params[]=Saudi Arabia&amp;params[]=%@",@"all"]; // downloadURL= [downloadURL stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; //downloadURL = [downloadURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSCharacterSet *doNotWant = [NSCharacterSet characterSetWithCharactersInString:@" "]; downloadURL = [[downloadURL componentsSeparatedByCharactersInSet: doNotWant] componentsJoinedByString:@"%20"]; NSLog(downloadURL); [download startDownloading:downloadURL]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload