We are accessing the PDF URL from our application and getting the PDF data. After converting our code base Swift2.3 to Swift4.2 we are getting 0 bytes of data as response. But when we open the same URL in the browser it is showing the PDF file. We are not getting any error also. In Swift2.3 code base, we are getting exact data value as valid bytes. Is there anything we need to configure in URLSession for getting the exact data bytes in Swift4.2.
//url - PDF server url value
let session:Foundation.URLSession = Foundation.URLSession(configuration:URLSessionConfiguration.default delegate:self delegateQueue:nil)
let task = session.dataTask(with: url, completionHandler:{(data,response,error) in
// here data coming as 0 bytes
})
task.resume()