I need to pass some parameters from iOS system to the server.
one of those parameters is timezone
, and I need to include the sign in front of the hour value like +02:00
I tried this:
let url = "http://my_server/my_page.php?timezone=+02:00"
let urlEncoded = url.stringByAddingPercentEncodingWithAllowedCharacters(.URLQueryAllowedCharacterSet())
But unfortunately didn't work. And at the server I got " " space instead of the "+" sign. (PHP
used on the server)
I saw Objective-C url encoding but really I don't need to encode http://..
, I only need the +
sign in the parameters list.
Also I look at Swift - encode URL, But when I send +
sign, PHP
server will omit it.