【发布时间】:2023-03-15 03:59:01
【问题描述】:
我是 Alamofire 的新手,所以如果这是一个菜鸟问题,我很抱歉:这个框架会自动存储 cookie?
这是因为我有这样一个简单的请求:
Alamofire.request(.POST, loginURL, parameters: ["fb_id": fbId, "fb_access_token": fbToken])
.responseJSON { response in
//print(response.request) // original URL request
//print(response.response) // URL response
//print(response.data) // server data
//print(response.result) // result of response serialization
if let JSON = response.result.value {
print("loginURL - JSON: \(JSON)")
}
}
此请求响应带有 cookie 会话,出于安全原因,我需要执行其他请求;奇怪的是,就像魔术一样,我已经可以在第一次 POST 之后执行其他请求,而无需手动读取 cookie 并存储它。我确定其他请求需要 cookie 会话,因为它们例如在邮递员上失败但不是在这里。
这只是一个功能?因为我在官方GitHub page 上也找不到任何内容。
【问题讨论】:
标签: ios swift post cookies alamofire