首页 > 解决方案 > Alamofire 请求在一分钟内超时

问题描述

当我调用HTTP POST RequestusingAlamofire时,它仅在一分钟内超时。实际上,响应是在请求 2 分钟后收到的。那么如何更改 alamofire 中的请求超时间隔?请帮忙……</p>

下面添加了使用 alamofire 发送请求的表单...

Alamofire.request("url", method: .post, parameters: params, encoding: JSONEncoding.default, headers: my custom header
            .validate(contentType: ["application/json"])
            .responseJSON { (response) in 
  switch response.result { 
    case .success(let value):
    //code
    case .failure(let error):
    //code
  }
}

标签: iostimeoutalamofireswift5

解决方案


推荐阅读