我想验证创建用户的OTP。我为此使用了POST RESTful API。所有创建的用户都有他们的Auth令牌。因此,当我验证用户OTP时,它会显示“无效身份验证”,但我在POST请求标头中发送令牌? 这是我的代码: -
let urlString = "http://192.168.182.81:8080/serviceplus/user/validateotp.json"
if let url = NSURL(string: urlString) {
let URLRequest = NSMutableURLRequest(URL: url)
let headers = [
"Authorization": "\(token)",
"Accept": "application/json"
]
Alamofire.request(.POST, URLRequest, headers: headers, parameters: ["otpcode": fields[0].text!]).responseJSON { response in
print("Error :- \(response.result.error)")
print("Result values :- \(response.result.value)")
}
}
我该怎么办?
谢谢.. :))