ASIHttpRequest parses URL with spaces

When ASIHttpRequest parses URL with spaces , the App error will occur.


For Example . When you input something liking this :


  http://myWebApp?clientName=Phone Li


The most troublesome issue will come to find you.


Using "stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding" ,when you get a bad url.


The sample of my code is:
       NSString *newUrl = [oldUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
发布了38 篇原创文章 · 获赞 24 · 访问量 9万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章