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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章