Hi, I'm problem, when I add this line: request.addValue("application/json", forHTTPHeaderField: "Content-Type")
To be able to see in the output, it doesn't write, but when I take this line of code, it writes.
My code: URLSession.shared.dataTask(with: request) { data, response, error in
if error == nil {
guard let data = data else {return}
guard let json = try? JSONSerialization.jsonObject(with: data, options: .allowFragments) else{
return
}
print("Sucesso")
print(json)
/*DispatchQueue.main.async(execute: {
do {
}catch {
}
})*/
} else {
print("Sem sucesso!")
}
} .resume()