iOS Swift不支持的URL

时间:2018-04-19 15:05:40

标签: ios swift rest

我有一个在tomcat上运行的REST Web服务,在92.126.230.210:9090/delete(这是一个假的ip,但结构是相同的)我想要消耗,但编译器输出告诉我"不支持URL"

我没有空格,所有字符都在ASCII表格中。

WS电话:

//uriParam = 92.126.230.210:9090/delete?uid=SAFAKEWDW
func deleteUserRESTCall(uri uriParam: String){
        URLSession.shared.dataTask(with: URL(string: uriParam)!) { data, response, error in
            if error != nil {
                print(error!.localizedDescription)
            }
            }.resume()
    }

1 个答案:

答案 0 :(得分:2)

网址缺少协议,例如extension Array { public func splitSorted(by condition: (Element, Element)->(Bool)) -> [[Element]] { var result = [[Element]]() var start = 0 var end = 0 while end != self.count - 1 { while end < self.count && condition(self[start], self[end]) { end += 1 } result.append(Array(self[start..<end])) start = end } return result } }