When i run this code it will give me this error:
2018-05-03 18:06:05.605035+0200 FNStats[4225:1826491] Task .<1> HTTP load failed (error code: 100 [1:100]) 2018-05-03 18:06:05.605179+0200 FNStats[4225:1826493] Task .<1> finished with error - code: 100
Can someone explaine to me what I am doing wrong!
let urlString = "https://api.fortnitetracker.com/v1/profile/pc/Danikemper010"
let url = NSURL(string: urlString)!
var request = URLRequest(url: url as URL)
request.setValue("TRN-Api-Key: c400d2a8-8a99-45e7-a62b-3cef2d74ce14", forHTTPHeaderField: "TRN-Api-Key: c400d2a8-8a99-45e7-a62b-3cef2d74ce14")
URLSession.shared.dataTask(with: request) { data, response, error in
if let responseData = data
{
do{
let json = try JSONSerialization.jsonObject(with: responseData, options: JSONSerialization.ReadingOptions.allowFragments)
print(json)
}catch{
print("Could not serialize")
}
}
}.resume()