1

GET API is not working on above IOS 13.3 (Time Out) and I am using Alamofire 5.0

Here is my API calling code.

let urlRequest = URLRequest(url: URL(string: "https://geturl")!)
let urlString = urlRequest.url?.absoluteString

    AF.request(urlString!,method: .get, parameters: nil, headers:nil).responseJSON { response in

          debugPrint(response)
          switch response.result {
              case .success(let json):
                    print(json as Any
                    DispatchQueue.main.async {
                    }
              case .failure(let error):
                    print(error)
          }
     }
HardikS
  • 656
  • 3
  • 10
Nayeem
  • 51
  • 5
  • have you cross-checked with Postman? Is it working properly there? – HardikS Jan 28 '20 at 08:57
  • Yes its working in Postman & simulator too but only on device i am getting timeout – Nayeem Jan 28 '20 at 09:01
  • maybe on your computer some proxy settings? try to call API with vpn – Alexandr Kolesnik Jan 28 '20 at 09:09
  • 1
    What’s the URLRequest for?. Practically it’s unused. You are creating an URL from a string, then the request from the URL, then getting back the URL and converting back to string. That’s pretty weird. And are you sure that the parameter is not supposed to be an URL? – vadian Jan 28 '20 at 09:17
  • @vadian Worked .. Some Proxy in Network so i connected to VPN its working fine, Thanks – Nayeem Jan 28 '20 at 11:32

0 Answers0