Trying to call the web service as follows , and experiencing random "The network connection was lost" error causing app crash on device as well as simulator.
Alamofire.request(url, method: .post, parameters: ["limit" : "3" , "offset" : self.storeArray?.count ?? 0], encoding: URLEncoding.default, headers: nil).responseJSON { (response:DataResponse<Any>) in
switch(response.result) {
case .success(_):
my error bellow
Optional(Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSUnderlyingError=0x608000a5f950 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x60800029fea0 [0x1136c0df0]>{length = 16, capacity = 16, bytes = 0x10020050a63e1c720000000000000000}, _kCFStreamErrorCodeKey=-4, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=http://lokomart.com/services/getSearchResultData, NSErrorFailingURLKey=http://lokomart.com/services/getSearchResultData, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-4, NSLocalizedDescription=The network connection was lost.})
// I have using php backend with godaddy deluxe hosting.
and also working with swift 3