Wondering if anyone can help me here:
private static func getURLRequestData(completion: @escaping (Data?) -> ()) {
// Gets the raw JSON Data
let session = URLSession(configuration: .default)
guard let url = URL(string: urlString) else { return }
var urlRequest = URLRequest(url: url)
let headers = [
"ts" : ts,
"apikey" : apiKey,
"hash" : hash,
"limit" : limit,
"orderBy" : orderedBy
]
urlRequest.allHTTPHeaderFields = headers
let task = session.dataTask(with: urlRequest) { (data, response, error) in
if error != nil {
print(#line, error!.localizedDescription)
}
print(response)
completion(data)
}
task.resume()
}
As you can see, I am setting the headers correctly with my API Key but for some reason I'm getting a 409 return which is a missing "user key".
Has anyone experienced anything like this. For what its worth, the exact same request is working in Paw