【问题标题】:Swift 5.1 & Alamofire 5.1 : GET method ERRORSwift 5.1 和 Alamofire 5.1:GET 方法错误
【发布时间】:2020-04-09 17:36:34
【问题描述】:

当传递标头和参数时:Alamofire.AFError.URLRequestValidationFailureReason.bodyDataInGETRequest(0 bytes)

 AF.request(urlString,method:.get, parameters: parameters, encoding: URLEncoding.httpBody, headers: headers).responseJSON { response in

              print(response)

 }

【问题讨论】:

  • 请分享与此问题相关的任何代码
  • 我们需要代码来帮助...

标签: ios swift alamofire afnetworking alamofire-request


【解决方案1】:

从 Apple 的 2019 操作系统版本开始,尝试使用正文数据发出 GET 请求将失败并出现错误。该值必须是nil。 Alamofire 在这里提供了它自己的错误,以便为 Alamofire 用户提供一致的体验,无论他们的代码在哪个操作系统上运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-12
    • 1970-01-01
    • 1970-01-01
    • 2017-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多