我正在使用Alamofire在网络服务上发布请求。此Web服务必须具有精确格式的参数“time = 00:00:00”。但是,如果我将参数创建为let params = ["time":"00:00:00"]
,则请求将失败。当我检查HTTPBody的值时,它显示time=16%3A00%3A00
。如何使请求使用冒号字符本身?
let params = ["time":"00:00:00"]
Alamofire.request(url!, method: .post, parameters: params, encoding: URLEncoding(), headers: headers).responseJSON { response in
// Check the http body.
print(String(data: (response.request?.httpBody!)!, encoding: .utf8)
}