Post method of Alamofire request response is “token_not_provided” Swift
$10-30 USD
Cancelado
Publicado hace más de 5 años
$10-30 USD
Pagado a la entrega
I get response with token and post this token with Alamofire on response of the request. I test that token is received and sent, also I tried to send random number as token and received same error on resposen - "token_not_provided".
API does not require header or token into header.
Request code is below:
[login to view URL](userRegURL, method: .post, parameters: parameters, encoding: [login to view URL]).responseJSON
{
response in
if let result = [login to view URL] {
let jsonData = result as! NSDictionary
tokenFromAPI = [login to view URL](forKey: "token") as! String
let phoneParameters: Parameters = [
"token" : tokenFromAPI,
"phone" : [login to view URL]!
]
let sendCodeURL = "https://aabbcc/member/send-code"
[login to view URL](sendCodeURL, method: .post, parameters: phoneParameters).responseJSON
{
response in
if let result = [login to view URL] {
let jsonData2 = result as! NSDictionary
print(phoneParameters)
print(jsonData2)
}
}
}
}
API documentation is shown below
Please make bids if you really know the problem with the code.