例如,我有以下代码:
let headers = ["If-None-Match": etag, "Authorization": "Token token=\(apiKey)"]
Alamofire.request(.GET, "\(AppSettings.ApiURL)/v1/users/", headers: headers).responseJSON { response in
guard let statusCode = response.response?.statusCode else {return}
print("status code: \(statusCode)")
}
我每次都会获得status code: 200
,而不是304
。返回304 status code
与curl或postman相同的请求。我不知道哪里出错了。任何帮助都非常感谢!