Answer the question
In order to leave comments, you need to log in
Why is swift not sending requests?
There is a server that responds remarkably to requests through the client side or through postman, in the application I use this code
guard let url = URL(string: "https://***.***.***.***/auth/login") else {
completion(.failure(.custom(errorMessage: "URL is not correct")))
return
}
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONEncoder().encode(body)
The operation couldn’t be completed. (test.AuthenticationError error 1.)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question