热门搜索 : 电子合同   签署   产品
首页 > 文档中心 > 银行卡归属地查询 > 示范代码
var url = "https://v.1dq.com/api/c43"
var httpArg = "key=您申请的key&bankcard=123456789&apiversion=2.0.5"
APISLA(url, httpArg: httpArg)
func  APISLA(httpUrl: String, httpArg: String) {
    var req = NSMutableURLRequest(URL: NSURL(string: httpUrl + "?" + httpArg)!)
    req.timeoutInterval = 6
    req.HTTPMethod = "GET"
    NSURLConnection.sendAsynchronousRequest(req, queue: NSOperationQueue.mainQueue()) {
        (response, data, error) -> Void in
        let res = response as! NSHTTPURLResponse
        println(res.statusCode)
        if let e = error{
            println("请求失败")
        }
        if let d = data {
            var content = NSString(data: d, encoding: NSUTF8StringEncoding)
            println(content)
        }
    }
}

现在注册,免费试用所有产品

免费体验