I wrote the code for my API but I didn’t wrote the code for the Bearer Token since I don’t know how to do it properly since I am new to swift 🙂 so if anyone could help me or reference me to a link on how to do it 🙂
This Is all I have about it in my code but its not working 🙁
let headers = [
"content-type": "application/json",
"authorizetoken": "NjQzODM2N0NDNDM4NDhCNDk3RkU0NjA0QUY0NjVENkE=",
"cache-control": "no-cache",
]
}
var request = URLRequest(url: url, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 120)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
2
Answers
and you can use it like
You need to update your allHTTPHeaderFields