我正在尝试发送短信,而我的网址号码是“http://api.appname.my/sendSms.php?message=hello&phone=687985< 6123488< 60149041982”,但它会缩短到这个“http://api.appname.my/sendSms.php?message=hello&phone=687985”,所以为什么要删除其他数字。这是我的代码
{{1}}
答案 0 :(得分:1)
我认为您应该将<
字符编码为%3C
let urlString = "http://api.appname.my/sendSms.php?message=hello&phone=\(number)"
let url = urlString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
print("Result: " + url!)
// Result: http://api.appname.my/sendSms.php?message=hello&phone=687985%3C6123488%3C60149041982