📜  swift alamofire x-www-form-urlencoded - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:00.489000             🧑  作者: Mango

代码示例3
let headers = [
    "Content-Type": "application/x-www-form-urlencoded"
]
let parameters = [
    "myParameter": "value"
]
let url = NSURL(string: "https://something.com")!
Alamofire.request(.POST, url, parameters: parameters, headers: headers, encoding: .URLEncodedInURL).response { request, response, data, error in
    print(request)
    print(response)
    print(data)
    print(error)
}