gpt4 book ai didi

ios - ParameterEncoding 没有成员 JSON

转载 作者:可可西里 更新时间:2023-11-01 02:14:12 25 4
gpt4 key购买 nike

当前代码是:

let mutableURLRequest = NSMutableURLRequest(url: URL(string: urlString)!)
mutableURLRequest.httpMethod = HTTPMethod.post.rawValue
let encodedURLRequest = ParameterEncoding.JSON.encode(mutableURLRequest, parameters: parameters).0
let data = encodedURLRequest.HTTPBody!

Alamofire.upload(mutableURLRequest, data: data)...

ParameterEncoding.JSON.encode 行在升级到 Alamofire4 时失败 - 请帮助 - 这几天一直困扰着我。

最佳答案

取自Alamofire documentation :

Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding.default)

关于ios - ParameterEncoding 没有成员 JSON,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39675314/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com