【发布时间】:2017-04-05 08:44:38
【问题描述】:
我正在尝试发送短信,而我的带有数字的网址是“http://api.appname.my/sendSms.php?message=hello&phone=687985http://api.appname.my/sendSms.php?message=hello&phone=687985”,所以它为什么要删除其他数字。这是我的代码
number = number + "60149041982"
let url = "http://api.appname.my/sendSms.php?message=hello&phone=\(number)"
Alamofire.request(url).response{ (responseObject) -> Void in
print(responseObject)
}
【问题讨论】:
-
您可能需要转义“stackoverflow.com/questions/24551816/swift-encode-url
-
实际上不需要api开发者添加这个来分隔数字。