i am using a GET method in which i have to pass a email address in the URL. API expects it to be encoded. I tried with the encoding options but the \'+\' character couldnt b
Try this :
let encodedEmail = emailAddressTxt.text!
var urlString = "http://yyy.xxx.com/User/GetUserDetailsByEmailAddress?EmailAddress=\(encodedEmail)"
urlString = urlString.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)
or
let encodedEmail = emailAddressTxt.text!
let urlString = "http://yyy.xxx.com/User/GetUserDetailsByEmailAddress?EmailAddress=\(encodedEmail!)"
urlString = urlString.addingPercentEncoding(withAllowedCharacters:.urlHostAllowed)
print(escapedString)