【发布时间】:2019-04-03 13:18:54
【问题描述】:
实际上我是 iOS 新手,现在我的任务是使用 Rxalamofire 发送 URL 请求。我完全不知道 Rxalamofire。以前我只使用 alamofire。以前我只使用 alamofire。现在我也像以前使用以前一样发送了 url 请求,但后来我发现 Rxalamofire 比 alamofire 好得多。不幸的是我无法发送 URL 请求。所以,谁能告诉我一步一步的过程。在此先感谢。
postParameters = ["username":mailid,"password":password]
Alamofire.request(Constants.loginapi, method: .post, parameters: postParameters, encoding: URLEncoding.default, headers: nil).responseJSON { response in
switch response.result {
case .success:
print(response)
case .failure(let error):
print(error)
}
}
【问题讨论】: