URL constructor doesn't work with some characters

后端 未结 2 755
余生分开走
余生分开走 2021-01-27 21:02

I\'m trying to call a php-script from my app using URLRequest. The Url path is generated in the String-Variable query and for the request I convert it like this

2条回答
  •  孤城傲影
    2021-01-27 21:29

    Split your URL in two separate parts:

    let baseURLString = "https://www.example.com"
    let pathComponent = "áűáeqw"
    let fullURL = URL(string: baseURLString)?.appendingPathComponent(pathComponent)
    

提交回复
热议问题