美文网首页
Swift 5 & Alamofire 5 : GET meth

Swift 5 & Alamofire 5 : GET meth

作者: Swift社区 | 来源:发表于2021-04-21 14:55 被阅读0次

    error: urlRequestValidationFailed(reason: Alamofire.AFError.URLRequestValidationFailureReason.bodyDataInGETRequest(2 bytes))

    解决方法

    使用 URLEncoding.default 代替 JSONEncoding.default

    AF.request(path, 
              method: .get, 
          parameters: params, 
            encoding: URLEncoding.default, 
             headers: nil)
      .response { (responseData) in
    
    }
    

    相关文章

      网友评论

          本文标题:Swift 5 & Alamofire 5 : GET meth

          本文链接:https://www.haomeiwen.com/subject/qowelltx.html